el-form表单回显问题?

interface FormTable {
  id: string;
  code: string;
  name: string;
  number: string;
  version_num: string;
  power: string;
  price_type: number;
  first_price: string;
  second_price: string;
  third_price: string;
  remark: string;
  type: string;
  create_time: string;
  update_time: string;
}
let formTable = reactive<FormTable>({
  id: "",
  code: "",
  name: "",
  number: "",
  version_num: "",
  power: "",
  price_type: 1,
  first_price: "",
  second_price: "",
  third_price: "",
  remark: "",
  type: "",
  create_time: "",
  update_time: "",
});

图片.png
图片.png
图片.png

阅读 503
2 个回答
新手上路,请多包涵

formTable是reactive定义的吗,直接赋值一个新对象导致丢失响应式了,可以换ref

const formTable = ref(null)

//watch
formTable.value = props.selectData
新手上路,请多包涵

formTable = props.selectData这个不对吧,reactive类型直接复制会丢失响应式

推荐问题
logo
Microsoft
子站问答
访问
宣传栏