1.情景還原
<template>
<el-button type="text" @click="open">點擊打開 Message Box</el-button>
</template>
<script>
export default {
methods: {
open() {
this.$confirm('此操作將永久刪除該文件, 是否繼續?', '提示', {
confirmButtonText: '確定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '刪除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消刪除'
});
});
}
}
}
</script>
- 感覺樣式太靠下邊了~~想要讓它往上一些
那么我們這么改
2.
this.$confirm('此操作將永久刪除該文件, 是否繼續?', '提示', {
confirmButtonText: '確定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'myClass'
})
3.附加在沒有scoped的style中
<style>
.myClass {
width: 350px;
}
</style>