一、定义样式
<style>
.confirm-p {
word-break: break-all;
}
</style>
定义的样式不能放在 scoped 的 style 中
二、使用样式
this.$confirm('您确定要删除 ' + row.name + ' 吗?删除后将无法恢复,请谨慎操作。', '提示', {
confirmButtonText: this.$t('common.confirm'),
cancelButtonText: this.$t('common.cancel'),
type: 'warning',
customClass: 'confirm-p'
}).then(() => {
this.doDeleteHandle(row, disabled)
}).catch((reason) => {
console.log(reason)
})
在 confirm 中添加 customClass: 'confirm-p' ,使用前面定义的样式