将重定向 link 添加到 AlertController 按钮
Adding a redirection link to an AlertController button
(Angular & 离子)
我想从我的 alertcontroller 模式向 play 商店添加一个 link。这可能吗?
const alert = this.alrtCrtl.create({
title: `...`,
subTitle: `...`,
message: `<div class="image-container"> <img id='...' alt='...' />`,
buttons: [ {
cssClass: `cancel-button`,
text: `X`,
},
{
cssClass: `secure-hub`,
text: `Go To Play Store`, <<<<<<< this button
}
],
});
alert.present();
您可以将 handler
添加到您的按钮,该按钮可以调用打开您的 playstore 的方法 link:
buttons: [ {
cssClass: `cancel-button`,
text: `X`,
},
{
cssClass: `secure-hub`,
text: `Go To Play Store`, //<<<<<<< this button,
handler: () => {
this.yourMethodToOpenUrl()
}
}
(Angular & 离子) 我想从我的 alertcontroller 模式向 play 商店添加一个 link。这可能吗?
const alert = this.alrtCrtl.create({
title: `...`,
subTitle: `...`,
message: `<div class="image-container"> <img id='...' alt='...' />`,
buttons: [ {
cssClass: `cancel-button`,
text: `X`,
},
{
cssClass: `secure-hub`,
text: `Go To Play Store`, <<<<<<< this button
}
],
});
alert.present();
您可以将 handler
添加到您的按钮,该按钮可以调用打开您的 playstore 的方法 link:
buttons: [ {
cssClass: `cancel-button`,
text: `X`,
},
{
cssClass: `secure-hub`,
text: `Go To Play Store`, //<<<<<<< this button,
handler: () => {
this.yourMethodToOpenUrl()
}
}