Ionic2 Popover 更改宽度 [英] Ionic2 Popover Change Width

查看:16
本文介绍了Ionic2 Popover 更改宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想更改一页的弹出框宽度.我试过这个:

I want to change the popover width of only 1 page. I tried this:

我不想在 variable.scss 文件中使用这个 $popover-ios-width因为它会改变所有页面的宽度.

I do not want to use this $popover-ios-width in variable.scss files since it changes the width on all pages.

推荐答案

@gabriel-barreto 的 answer 完全没问题.不过,我想它在其他版本中需要额外考虑.

@gabriel-barreto's answer is totally fine. However, I guess it needs an additional consideration in other versions.

在 Ionic 3.6 中,自定义类被添加到 元素中.为了覆盖 .popover-content 类中设置的默认宽度规则,您的选择器应该是:

In Ionic 3.6 the custom class is added to the <ion-popover> element. In order to override the default width rule set in .popover-content class, your selector should be:

.custom-popover .popover-content {
  width: 60%;
}

这篇关于Ionic2 Popover 更改宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆