这是ElementUI 的弹窗,官方给出的代码是这样的
<script>
export default {
methods: {
open2() {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
}
</script>
点击取消则会关闭弹窗和遮罩层
然后,自己写
一样有弹窗,但是点击关闭之后
弹窗关闭了,但是遮罩层还在。 求指导怎么回事。。??
你的父级层以上也用了
el-dialog
,el-dialog
层级会自动计算,所以你用的时候可以加上modal-append-to-body:false
只相对于你的父级弹出