Demo:保存视图数据的逻辑增加防抖操作,优化性能

This commit is contained in:
wanglin2 2023-08-08 16:29:29 +08:00
parent 86b184d5c1
commit 69faa8bb3e

View File

@ -122,7 +122,8 @@ export default {
return {
mindMap: null,
mindMapData: null,
prevImg: ''
prevImg: '',
storeConfigTimer: null
}
},
computed: {
@ -186,9 +187,12 @@ export default {
storeData(data)
})
this.$bus.$on('view_data_change', data => {
storeConfig({
view: data
})
clearTimeout(this.storeConfigTimer)
this.storeConfigTimer = setTimeout(() => {
storeConfig({
view: data
})
}, 1000)
})
},