mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-24 20:07:43 +08:00
Demo:保存视图数据的逻辑增加防抖操作,优化性能
This commit is contained in:
parent
86b184d5c1
commit
69faa8bb3e
@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user