forked from github/dataease
feat:增加画布鼠标悬停虚线边框
This commit is contained in:
parent
33468cf39b
commit
31b291a3ec
@ -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 {
|
|||||||
},
|
},
|
||||||
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 {
|
|||||||
|
|
||||||
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 {
|
|||||||
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 {
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mouseon {
|
.mouseOn {
|
||||||
outline: 1px dashed #70c0ff;
|
outline: 1px dashed #70c0ff;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user