html - 更改 ionic 弹出窗口的宽度

标签 html css ionic-framework popup

我想在不影响其他元素的情况下更改 ionic 元素中特定弹出窗口的宽度。

 var alertPopup = $ionicPopup.alert({
     cssClass: 'popupg',
      title: coe,
      template: text
    });

最佳答案

如果您使用的是 Ionic 3

在你的 .ts 文件上:

    const alert = await this.alertCtrl.create({
        header: 'Sorry',
        cssClass: 'my-custom-alert',
        message: 'message',
        buttons: ['Find by name ?']
    });

在你的 global.scss 上

.my-custom-alert .alert-wrapper {
  min-width: 450px !important;
}

样式前弹出: enter image description here

样式后弹出(最小宽度:450 像素)

enter image description here

希望对您有所帮助:)

关于html - 更改 ionic 弹出窗口的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40111073/

相关文章:

javascript - 我无法加载模板 Angular JS + Ionic + Gulpjs

ios - 尝试添加 ios 平台项目时出现 Ionic Framework 错误

css - 尝试在网页上创建固定的插图

java - 我怎样才能用 Action 风格改变jsp html链接

php - 如何在mysql数据库中存储html

jquery - 使用 jquery 的产品列表。方法移除()

jquery - 我在 css 和 jcarousel lite 上遇到了麻烦

javascript - 我有一个 jQuery 代码,其中不透明度随着光标下降而上升。我该如何扭转它?

javascript - Angular wp-api 无法获取 X_Total_Pages 的 header

html - 将鼠标悬停在省略跨度上时防止文本重叠