如何在Vue.js中的确认对话框中创建新行

时间:2018-06-14 05:31:47

标签: javascript vue.js dialog

所以我在下面有一个确认对话框,每当他点击按钮时都会向用户发出警告,但我想要的是在问题后创建一个新行并插入注释。

this.$dialog.confirm("Create Group","Would you like to create group "+ this.groupName +"?<br/>(NOTE: Selected project or employee/s will be automatically assigned to this group.)")

结果如下:

enter image description here

我的<br/>被解释为文字。我也尝试了/n但也没有用,它只是被一个空格字符所取代。

1 个答案:

答案 0 :(得分:1)

基于the vuejs-dialog plugin's readme page

您可以将选项html设置为true,以便<br>可以使用

演示:https://jsfiddle.net/jacobgoh101/kyabo054/2/

e.g。

this.$dialog.confirm('Please confirm to continue<br>NextLine', {        
  html: true      
})