forked from ymm-tech/gods-pen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasePanel.js
44 lines (44 loc) · 1.04 KB
/
BasePanel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export default {
name: 'node',
data: function (params) {
return {
showMask: false,
dragPanel: null
}
},
watch: {},
mounted: function () {
// panel 标题开始拖动事件处理
this.ema.bind('dock.panelTitleDragStart', (target, info) => {
this.showMask = true
this.dragPanel = target
this.dragInfo = info
})
// 标题拖动完成事件处理
this.ema.bind('dock.panelTitleDragEnd', (value) => {
this.showMask = false
})
},
methods: {
dragover: function (ev) {
ev.stopPropagation()
ev.preventDefault()
},
dragleave: function (ev) {
ev.stopPropagation()
ev.preventDefault()
this.ema.fire('dock.maskDragleave')
},
dragenter: function (ev) {
ev.stopPropagation()
this.ema.fire('dock.maskDragenter', ev, this)
},
drop: function (ev) {
ev.stopPropagation()
ev.preventDefault()
this.ema.fire('dock.panelTitleDrop', ev)
// 处理元素的添加移除等逻辑
this.showMask = false
}
}
}