Commit 9d79e4ef by 李伟康

refactor(watch): 优化客户信息的实时监听

- 将 show 方法改为 show 属性,以实现更准确的监听
- 添加 immediate 选项,确保在数据初始化时也能触发监听
1 parent 88f38faf
...@@ -129,12 +129,15 @@ export default { ...@@ -129,12 +129,15 @@ export default {
if (newval) this.customerInfo = newval if (newval) this.customerInfo = newval
} }
}, },
show (n) { show: {
immediate: true,
handler (n) {
setTimeout(() => { setTimeout(() => {
if (n && !this.customerInfo.carModel && this.isAito) this.$refs.carBrandListVisible.autoSelect() if (n && !this.customerInfo.carModel && this.isAito) this.$refs.carBrandListVisible.autoSelect()
}, 1e3) }, 1e3)
} }
}, },
},
computed: { computed: {
watchCustomerInfo () { watchCustomerInfo () {
return this.$store.state.user.customerInfo return this.$store.state.user.customerInfo
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!