赞
踩
在开发中,这是一个vue2的老项目改成vue3的。突然遇到一个bug,寻找了最后发现是vue2和vue3版本不同造成问题。
大概就是 input标签双向绑定一个对象里面的某个字段。
const form = ref({ pushContent: "" });
return {
form,
};
<el-form ref="form" :model="form" size="small" label-position="top">
<h3>推送设置</h3>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="推送内容">
<el-input
v-model="form.pushContent"
placeholder="请输入推送内容"
></el-input> </el-form-item
></el-col>
</el-row>
</el-form>
把这里的ref属性设置的值,不能和setup里面需要用到双向绑定的变量的名字一样。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。