Commit 1d4c273f by 李伟康

fix(step-one): 修复上架类型切换时表单字段重置逻辑

- 添加 oldVal 参数以区分用户操作和初始化赋值
- 仅在用户真正切换上架类型时执行字段重置
- 避免 immediate 触发时误清空表单数据
- 移除不必要的 deep 监听配置
1 parent 52e2f28c
...@@ -222,8 +222,10 @@ export default { ...@@ -222,8 +222,10 @@ export default {
deep: true, deep: true,
}, },
'infoForm.shelfType': { 'infoForm.shelfType': {
handler(val) { handler(val, oldVal) {
console.log(val) console.log(val)
// 仅在用户真正切换上架类型时执行重置,避免 immediate 和程序赋值时误清空
if (oldVal === undefined) return
if (val == 2) { if (val == 2) {
this.infoForm.merchantId = '' this.infoForm.merchantId = ''
this.infoForm.merchantName = '' this.infoForm.merchantName = ''
...@@ -231,7 +233,6 @@ export default { ...@@ -231,7 +233,6 @@ export default {
this.infoForm.baseSceneCode = [] this.infoForm.baseSceneCode = []
}, },
immediate: true, immediate: true,
deep: true,
} }
}, },
computed: { computed: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!