Demo:保存视图数据的逻辑增加防抖操作,优化性能
This commit is contained in:
parent
86b184d5c1
commit
69faa8bb3e
@ -122,7 +122,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
mindMap: null,
|
mindMap: null,
|
||||||
mindMapData: null,
|
mindMapData: null,
|
||||||
prevImg: ''
|
prevImg: '',
|
||||||
|
storeConfigTimer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -186,9 +187,12 @@ export default {
|
|||||||
storeData(data)
|
storeData(data)
|
||||||
})
|
})
|
||||||
this.$bus.$on('view_data_change', data => {
|
this.$bus.$on('view_data_change', data => {
|
||||||
storeConfig({
|
clearTimeout(this.storeConfigTimer)
|
||||||
view: data
|
this.storeConfigTimer = setTimeout(() => {
|
||||||
})
|
storeConfig({
|
||||||
|
view: data
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user