Update Count.vue

解决刚进入脑图 Ctrl+Z操作导致数值全部归0的问题
This commit is contained in:
One 2025-03-25 11:14:23 +08:00 committed by GitHub
parent c62ee071f6
commit e0130f7004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,7 @@ export default {
* @Desc: 监听数据变化
*/
onDataChange(data) {
if (!data) return
this.textStr = ''
this.words = 0
this.num = 0
@ -70,7 +71,6 @@ export default {
* @Desc: 遍历
*/
walk(data) {
if (!data) return
this.num++
this.textStr += String(data.data.text) || ''
if (data.children && data.children.length > 0) {