在标签里面写了个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删除。