showModal content 内容换行

发布于 6 年前作者 yangao14736 次浏览最后编辑 6 年前来自 ask

发起的 内容 是

const content = ‘确定发起拼单吗?\n一旦发起,信息将不能修改。’

换行不起效吗

2 回复
xiuyingshen
xiuyingshen1 楼6 年前

亲测:\r\n在手机上有效

wx.showModal({
      title: '提示',
      content: '第一行内容\r\n第二行内容\r\n第三行内容\r\n第四行内容',
      success: function (res) {
        if (res.confirm) {
          console.log('用户点击确定')
        else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })1


yeping
yeping2 楼4 年前

在开发者工具里面看没换行,真机上是换行的。