Initial commit to release
This commit is contained in:
18
packages/editor-ui/src/components/mixins/nodeIndex.ts
Normal file
18
packages/editor-ui/src/components/mixins/nodeIndex.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export const nodeIndex = Vue.extend({
|
||||
methods: {
|
||||
getNodeIndex (nodeName: string): string {
|
||||
let uniqueId = this.$store.getters.getNodeIndex(nodeName);
|
||||
|
||||
if (uniqueId === -1) {
|
||||
this.$store.commit('addToNodeIndex', nodeName);
|
||||
uniqueId = this.$store.getters.getNodeIndex(nodeName);
|
||||
}
|
||||
|
||||
// We return as string as draggable and jsplumb seems to make problems
|
||||
// when numbers are given
|
||||
return uniqueId.toString();
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user