js代码:
const confirmText = ['(1)第一行', '(2)第二行','(3)第三行']
const newDatas = []
const h = this.$createElement
for (const i in confirmText) {
newDatas.push(h('p', null, confirmText[i]))
}
this.$confirm('提示', {
title:'提示',
message: h('div', null, newDatas),
confirmButtonText: '确定',
cancelButtonText: '关闭',
type: 'warning'
}).then(()=>{//点击“确定”按钮后执行的方法
alert("确定")
}).catch(()=>{//点击“关闭”按钮后执行的方法
alert("关闭")
})
效果如图: