el-dialog中获取el-table组件的ref值报undefined错误!
问题描述:在el-dialog
中对话框显示后, 通过ref
获取table
时, 结果返回undefined
!
解决方法:利用this.$nextTick(()
实现
clickDialog() {
this.dialogVisible = true
//弹窗框全部执行完成后执行下面
this.$nextTick(() => {
const thisT = this.$refs.table //放到外层也会报错
console.log('thisT1', typeof thisT)
console.log('thisT2', thisT)
})
}
以上是编程学习网小编为您介绍的“el-dialog中获取el-table组件的ref值报undefined错误!”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。