直接使用以下的方法,报错信息是`_this.$refs.singleTable.toggleAllSelection is not a function
this.$refs.singleTable.toggleAllSelection()
看了网上的解决方法,加了this.$nextTick,代码如下,但还是报错Error in nextTick: "TypeError: _this.$refs.singleTable.toggleAllSelection is not a function"
_this.$nextTick(() => {
_this.$refs.singleTable.toggleAllSelection()
})
报错信息是this.$refs.singleTable.toggleAllSelection这个东西不存在或者有错误,所以我决定把this.$refs.singleTable打印出来看看是什么东西!
console.log(this.$refs.singleTable);
打印出来了是这么一个东西,看他的格式应该是类似数组

再把它展开,终于在中间部分找到了这个方法,所以这个方法并不是直接this.$refs.singleTable调用,而是在this.$refs.singleTable[0]里面

解决办法:
this.$refs.singleTable改成this.$refs.singleTable[0]解决
代码:
this.$nextTick(() => {
this.$refs.singleTable[0].toggleAllSelection()
})


![[网络安全]在win2000虚拟机上创建隐藏账户](https://img-blog.csdnimg.cn/direct/17e375bd0c094c97920361bd82f2ec7d.bmp)
















