const h = this.$createElement;
this.$confirm(
提示,
{
title: that.$t('confirm.information'),
message: h('div', null, [
h('span', null, '删除'),
h('br', null, ''),
h('div', {
// 普通html特性
// 相当于`v-bind:style`
style: {
'margin-top': '5px',
color: '#FF7D7C',
fontSize: '12px',
background: '#FFEBEB',
padding: '5px',
},
},
'删除'
]),
showCancelButton: true,
confirmButtonText: this.$t('confirm.confirm'),
cancelButtonText: this.$t('confirm.cancel'),
type: 'warning'
}
).then((result) => {
}
}
});
本文介绍在Vue.js项目中如何使用this.$confirm方法创建警告对话框,包含自定义样式及多语言支持,实现删除确认功能。

4654

被折叠的 条评论
为什么被折叠?



