美文网首页
Cannot read properties of undefi

Cannot read properties of undefi

作者: 爱学习的小仙女早睡早起 | 来源:发表于2022-08-09 19:51 被阅读0次

Cannot read properties of undefined (reading 'indexOf')
at VueComponent.resetField (index.js:1:370572)

image.png

elementUI源码报错,原因竟然是form-item没加prop,折腾了一两个小时,真是服了。

rules按照表单的prop来的 用了那个resetfieds必须每个<el-form-item>都加prop!!

image.png

因为最后这个表单是个纯展示的所以没有写prop,结果就在关闭弹窗的方法里调用了this.$refs["addForm"].resetFields();一直报错!!!!真坑!!

表单重置 this.$refs.form.resetFields() 也需要 el-form-item 绑定 prop, 否则无效

相关文章

网友评论

      本文标题:Cannot read properties of undefi

      本文链接:https://www.haomeiwen.com/subject/dronwrtx.html