ionicpopup 内容中是否可以有换行符?
我正在尝试这样做:
$ionicPopup.alert({
title: 'Now what?',
content: "To start receiving messages: \n"
+ " - Open the side menu (button on top left) \n"
+ " - Tap 'Add Organisations' \n"
+ " - Browse the list of organisations available \n"
+ "or \n"
+ " - Enter a Passphrase to join a private group. \n \n"
+ "Once you've subscribed to an organisation, you'll start receiving messages from them.",
buttons: [
{ text: "Don't show me again" },
{
text: 'Okay',
type: 'button-positive'
}
]
}).then(function(res) {
if(res) {
console.log('You are sure');
} else {
console.log('You are not sure');
}
});
我的换行符不起作用。我将弹出窗口中的内容视为一个没有换行的长段落。
这可能吗?
最佳答案
是的,可以在 ionic 弹出内容中包含换行符。
替换 \n 与
标签,它的工作原理。 ionic 框架在执行该 javascript 后输出 HTML。它也适用于 html 字符串单引号字符串。
关于popup - ionicpopup 内容中的换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24403017/