Ngx-Bootstrap弹出窗口未设置正确的高度或宽度 [英] Ngx-Bootstrap popover not setting correct height or width
问题描述
我正在尝试在Ionic 2中使用 ngx-bootstrap Angular 2应用程序,由于某种原因,弹出窗口在我的视图中无法正确显示:
I am trying to use ngx-bootstrap in my Ionic 2 / Angular 2 app and for some reason the popover is not displaying correctly in my view:
<button
placement="right"
[outsideClick]="true"
popover="this is a teseofnwifo ef efo efoih wefohwefo wef h ioef whefhweofihwoeht"
[isOpen]="true"
triggers="click"
ion-button full outline
class="flex-col rounded box-shadow"
color="primary"
style="height:100%;font-size:16px;border-width:1px;"
(click)="goTo('new-client')" #1>
<i class="fa fa-user-plus text-shadow" padding style="font-size: 150px;color:red;"></i>
<span style="font-size:32px;text-transform:none;">New Client</span>
</button>
我不认为我的按钮样式会影响弹出窗口,因为它显示为单独的组件,但是显示弹出窗口时,其width
和height
都设置为4px.我不确定要在哪里设置它,或者我是否在某个地方缺少一些javascript.
I don't believe my button styling should impact the popover as its rendered as a seperate component, but when the popover is displayed, both its width
and height
are set to 4px. I'm not sure where it's being set or if I'm missing some javascript somewhere..
app.module.ts
import { PopoverModule } from 'ngx-bootstrap/popover';
@NgModule({
declarations: [...],
imports: [
PopoverModule.forRoot()
]
...
})
推荐答案
Set container="body", as in demo: https://valor-software.com/ngx-bootstrap/#/popover#container-body
如果它可以固定大小,则说明某些因素会影响弹出式窗口样式
If it will fix size then something is affecting popover style
这篇关于Ngx-Bootstrap弹出窗口未设置正确的高度或宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!