refactor(editor): create ndv store (#4409)
* refactor ndv module out * update active node in root state * simplify * fix conflict * fix dragging
This commit is contained in:
@@ -67,10 +67,10 @@ export default Vue.extend({
|
||||
},
|
||||
computed: {
|
||||
canDrop(): boolean {
|
||||
return this.$store.getters['ui/canDraggableDrop'];
|
||||
return this.$store.getters['ndv/canDraggableDrop'];
|
||||
},
|
||||
stickyPosition(): XYPosition | null {
|
||||
return this.$store.getters['ui/draggableStickyPos'];
|
||||
return this.$store.getters['ndv/draggableStickyPos'];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -111,7 +111,7 @@ export default Vue.extend({
|
||||
this.isDragging = true;
|
||||
|
||||
const data = this.targetDataKey && this.draggingEl ? this.draggingEl.dataset.value : (this.data || '');
|
||||
this.$store.commit('ui/draggableStartDragging', {type: this.type, data });
|
||||
this.$store.commit('ndv/draggableStartDragging', {type: this.type, data });
|
||||
|
||||
this.$emit('dragstart', this.draggingEl);
|
||||
document.body.style.cursor = 'grabbing';
|
||||
@@ -141,7 +141,7 @@ export default Vue.extend({
|
||||
this.$emit('dragend', this.draggingEl);
|
||||
this.isDragging = false;
|
||||
this.draggingEl = null;
|
||||
this.$store.commit('ui/draggableStopDragging');
|
||||
this.$store.commit('ndv/draggableStopDragging');
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user