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