sadais-piui 1.2.7-beta88 → 1.2.7-beta89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -346,6 +346,7 @@ export default {
|
|
|
346
346
|
watch: {
|
|
347
347
|
items: {
|
|
348
348
|
immediate: true,
|
|
349
|
+
deep: true,
|
|
349
350
|
handler() {
|
|
350
351
|
this.rebuildItems()
|
|
351
352
|
}
|
|
@@ -360,12 +361,14 @@ export default {
|
|
|
360
361
|
|
|
361
362
|
methods: {
|
|
362
363
|
rebuildItems() {
|
|
364
|
+
console.log('重建innerItems')
|
|
363
365
|
/**
|
|
364
366
|
* 以非递归的方式 深度拷贝items 且建立父子节点关系
|
|
365
367
|
* 目的为了不影响外部传入的prop: items
|
|
366
368
|
* 写成非递归的目的 是为了防止树的层次太深,
|
|
367
369
|
* 递归调用太多次,导致栈溢出
|
|
368
370
|
*/
|
|
371
|
+
this.currentItem = this.$pi.lang.cloneDeep(this.rootItem)
|
|
369
372
|
const innerItems = []
|
|
370
373
|
// 初始化堆栈 为items的根节点
|
|
371
374
|
const stack = [...this.items]
|