类似于这种:
this.$confirm('确定删除吗?删除后不可恢复!!!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs.tableData.selection
})
this嵌套this时
因为this嵌套指向问题,所以找不到$refs
需要在最外层定义一个 let that=this ,来保证他指向的是最顶层的this
let that=this
this.$confirm('确定删除吗?删除后不可恢复!!!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.$refs.tableData.selection
})