element-ui报错Cannot read property 'resetFields' of undefined


这是一个很奇怪的问题,我子组件的模态框保存,结果父组件模态框会报element-ui报错Cannot read property 'resetFields' of undefined
原因是我table数据渲染了,可是我模态框还没有mounted
解决办法
第一个,不太成功

   this.$nextTick(() => {
         this.$refs['pointForm'].resetFields()
       })

第二个方法如下,成功

    if (this.$refs['pointForm'] !== undefined) {
        this.$refs['pointForm'].resetFields()
      }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM