|
1 | 1 | /*! |
2 | | - * he-tree-vue v1.1.2 |
| 2 | + * he-tree-vue v1.1.3 |
3 | 3 | * (c) phphe <phphe@outlook.com> (https://github.com/phphe) |
4 | 4 | * Homepage: https://he-tree-vue.phphe.com |
5 | 5 | * Released under the MIT License. |
6 | 6 | */ |
7 | 7 | import _defineProperty from '@babel/runtime/helpers/defineProperty'; |
8 | | -import { TreeData, findParent, hasClass, getOffset, getBoundingClientRect, elementsFromPoint, isDescendantOf, attachCache, insertAfter, removeEl, waitTime, binarySearch, findNodeList, appendTo, insertBefore, prependTo, createElementFromHTML, addClass, iterateAll, resolveValueOrGettter, arrayWithoutEnd, arrayLast } from 'helper-js'; |
| 8 | +import { TreeData, strRand, findParent, hasClass, getOffset, getBoundingClientRect, elementsFromPoint, isDescendantOf, attachCache, insertAfter, removeEl, waitTime, binarySearch, findNodeList, appendTo, insertBefore, prependTo, createElementFromHTML, addClass, iterateAll, resolveValueOrGettter, arrayWithoutEnd, arrayLast } from 'helper-js'; |
9 | 9 | import { updatablePropsEvenUnbound, hookHelper } from 'vue-functions'; |
10 | 10 | import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs'; |
11 | 11 | import Vue from 'vue'; |
@@ -111,7 +111,7 @@ var template = function template(h) { |
111 | 111 | return h("div", { |
112 | 112 | "class": "he-tree ".concat(this.treeClass), |
113 | 113 | "attrs": { |
114 | | - "data-tree-id": this._uid |
| 114 | + "data-tree-id": this.treeId |
115 | 115 | } |
116 | 116 | }, [this.blockHeader && this.blockHeader(), childrenListTpl(this.rootNode.children, this.rootNode, []), this.blockFooter && this.blockFooter()]); |
117 | 117 | }; |
@@ -139,7 +139,8 @@ var Tree = { |
139 | 139 | data() { |
140 | 140 | return { |
141 | 141 | trees, |
142 | | - treeClass: '' |
| 142 | + treeClass: '', |
| 143 | + treeId: strRand() |
143 | 144 | }; |
144 | 145 | }, |
145 | 146 |
|
@@ -219,9 +220,9 @@ var Tree = { |
219 | 220 | immediate: true |
220 | 221 | }); // |
221 | 222 |
|
222 | | - this.$set(this.trees, this._uid, this); |
| 223 | + this.$set(this.trees, this.treeId, this); |
223 | 224 | this.$once('hook:beforeDestroy', () => { |
224 | | - this.$delete(this.trees, this._uid); |
| 225 | + this.$delete(this.trees, this.treeId); |
225 | 226 | }); |
226 | 227 | }, |
227 | 228 |
|
|
0 commit comments