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

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

 

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

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

 

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

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




 




posted @   front-gl  阅读(615)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
历史上的今天:
2018-11-16 window.requestAnimationFrame
2018-11-16 HTML5 canvas clearRect() 方法
2018-11-16 canvas save()和canvas restore()状态的保存和恢复使用方法及实例
2017-11-16 bootstrap+vue简易留言板
2017-11-16 vue_模板渲染
2017-11-16 vue_表单控件
点击右上角即可分享
微信分享提示