点1 2 3 右边的x弹框
<el-table-column
type="expand">
<template slot-scope="scope">
<el-row v-for="(item) in scope.row.date1"
:key="item">
<el-col :span="5">
<el-tag>{{item}}</el-tag>
<i class="el-icon-caret-right"></i>
</el-col>
<el-col :span="19">
<el-row :gutter="20">
<el-col :span="10"
style="background-color: pink; margin: 0 .625rem; text-align: center;">
<el-tag type="success"
closable
v-for="item in tableData[0].date1"
:key="item"
@close="handleClose(item)">{{item}}</el-tag>
</el-col>
<el-col :span="12 "
style="background-color:red; ">
</el-col>
</el-row>
</el-col>
</el-row>
</template>
</el-table-column>
methods: {
async handleClose (tag) {
// const confirmResult = await this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
this.tableData[0].date1.splice(this.tableData[0].date1.indexOf(tag), 1)
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
// .catch((err) => {
// return err
// });
// console.log(confirmResult)
},
常量 confirmResult 点确定按钮 返回confirm字符串 点取消返还cancel字符串 可以 通过 if(confirm==xxx){进行逻辑处理}