在標簽里面寫了個ref="table1",然后js里使用this.$refs.table1訪問報錯:Cannot read properties of undefined (reading '$refs')

解決辦法:放到this.$nextTick(function(){});函數里使用,就可以訪問到了
this.$nextTick(function(){ console.log(this.$refs.table1); this.$refs.table1.lazy=true });

。
在標簽里面寫了個ref="table1",然后js里使用this.$refs.table1訪問報錯:Cannot read properties of undefined (reading '$refs')

解決辦法:放到this.$nextTick(function(){});函數里使用,就可以訪問到了
this.$nextTick(function(){ console.log(this.$refs.table1); this.$refs.table1.lazy=true });

。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。