为什么换行符在警报打字稿中不起作用?我已经尝试过\,\r,,但它不起作用,这是我想要放置换行符的代码,
else if(isVerified == true && localStorage.getItem("verified") == "false"){
this.alert.create({
title: "You are almost there! ",
message: "As of the moment you can only n receive items (Receiver) from other users of PlsDala. n To Add a travel plan and deliver items (Courier) , and n avail a delivery service (Receiver)." +"rn" + "Please prepare: nnn One (1) valid ID nn One (1) copy of your Birth Certificate n Two (2) latest copy of your 2x2 picture n For your personal interview at this Address: n You can call this number () for more details",
inputs: [{
type: 'checkbox',
label: 'Don't show this again',
handler: data=>{
localStorage.setItem("verified", ""+data.checked+"");
}
}],
buttons: [{
text: "Ok",
role: 'cancel',
}]
}).present();
}
}
您可以在警报的消息字段中使用 html 语法,请尝试使用
而不是换行符。
取决于显示警报的位置。这不是打字稿错误 因为错误的显示不是由打字稿完成的。你必须 根据显示的位置使用换行符 警报。
n
适用于 Linux 控制台。但是,如果要在网页中显示它,请改用相应的换行符,即<br/>