提交 31b291a3 authored 作者: wangjiahao's avatar wangjiahao

feat:增加画布鼠标悬停虚线边框

上级 33468cf3
...@@ -26,10 +26,6 @@ export default { ...@@ -26,10 +26,6 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
mouseon: {
type: Boolean,
default: false
},
element: { element: {
require: true, require: true,
type: Object type: Object
...@@ -45,6 +41,7 @@ export default { ...@@ -45,6 +41,7 @@ export default {
}, },
data() { data() {
return { return {
mouseOn: false,
pointList: ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l'], // 八个方向 pointList: ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l'], // 八个方向
initialAngle: { // 每个点对应的初始角度 initialAngle: { // 每个点对应的初始角度
lt: 0, lt: 0,
...@@ -72,13 +69,7 @@ export default { ...@@ -72,13 +69,7 @@ export default {
computed: { computed: {
classInfo() { classInfo() {
if (this.active) { return this.active ? 'active' : (this.mouseOn ? 'mouseOn' : '')
return 'active'
} else if (this.mouseon) {
return 'mouseon'
} else {
return ''
}
}, },
...mapState([ ...mapState([
'curComponent', 'curComponent',
...@@ -100,11 +91,11 @@ export default { ...@@ -100,11 +91,11 @@ export default {
methods: { methods: {
// 鼠标移入事件 // 鼠标移入事件
enter() { enter() {
this.mouseon = true this.mouseOn = true
}, },
// 鼠标移出事件 // 鼠标移出事件
leave() { leave() {
this.mouseon = false this.mouseOn = false
}, },
isActive() { isActive() {
return this.active && !this.element.isLock return this.active && !this.element.isLock
...@@ -379,7 +370,7 @@ export default { ...@@ -379,7 +370,7 @@ export default {
user-select: none; user-select: none;
} }
.mouseon { .mouseOn {
outline: 1px dashed #70c0ff; outline: 1px dashed #70c0ff;
user-select: none; user-select: none;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论