使用饿了么ui表单验证报错: [Element Warn][Form]model is required for validat
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
[Element Warn][Form]model is required for validat
如文末的完整例子:
该提示说的是 form表单需要一个绑定一个 对象(使用:model="editform" 不能使用v-model="editform"),
同时v-model="multipleSelectionStudent" 的multipleSelectionStudent一定一定一定要在editform对象中,
而例子中v-model="multipleSelectionStudent" 的multipleSelectionStudent就不一定在editform对象中,因为此字段,没有做验证.
<el-form :model="editForm" ref="form" label-position="left" label-width="100px"> <el-row :gutter="24"> <el-col :span="12"> <el-form-item label="姓名"> <el-input v-model="multipleSelectionStudent" placeholder="请选择"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="地区" prop="selectSources" :rules="[ { required: true, message: '请选择地区', trigger: 'change'}]"> <el-cascader v-model="editForm.selectSources" placeholder="请选择" :clearable="true" :options="options.resourceGroup" change-on-select :props="cascaderProp" class="el-cascader-100p" ></el-cascader> </el-form-item> </el-col> </el-row> </el-form>
export default { data():{ return { editForm: { selectSources: [], }, } } }
如果在使用表单验证出现,表单验证的prop,规则都写的没有错,输入框有输入东西,但是就是一直无法验证通过可以看我
的另一文章 【饿了么ui表单的验证有输入东西但是一直无法通过】
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:1 个月前 )
c345bb45
5 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 5 个月前
更多推荐
已为社区贡献5条内容
所有评论(0)