admin管理员组文章数量:1424977
I am using vuejs with bulma and buefy. I am using buefy modal and trying to set the modal width using its 'width' property. I tried to specify it in the html as well as using javascript to open the modal.
this.$modal.open({
parent: this,
ponent: dummyComponent,
width: 720
})
Can someone please help me out.
I am using vuejs with bulma and buefy. I am using buefy modal and trying to set the modal width using its 'width' property. I tried to specify it in the html as well as using javascript to open the modal.
this.$modal.open({
parent: this,
ponent: dummyComponent,
width: 720
})
Can someone please help me out.
Share Improve this question asked Jun 6, 2018 at 11:20 Vipul SharmaVipul Sharma 7983 gold badges11 silver badges25 bronze badges2 Answers
Reset to default 6You also need to set style="width: auto" in your ponent, then the width you set when opening the modal is taken into account.
Then the js part would stay
this.$modal.open({
parent: this,
ponent: dummyComponent,
width: 720
})
and your ponent would be
<template>
<div class="modal-card" style="width: auto">
<!-- Content es here... -->
</div>
</template>
Examples in the buefy documentation include it as well but they don't explicitly state that you need it to make setting the width work.
Actually, for me it doesn't work.
this.$modal.open({
parent: this,
ponent: dummyComponent,
width: 1200
})
It produces modal with 640px in width. If I set
<template>
<div class="modal-card" style="width: auto">
<!-- Content es here... -->
</div>
</template>
It produces even narrower modal, 460px. Not sure why. My solution was:
<style lang="stylus" scoped>
.modal-card
width: auto
@media (min-width: 1200px)
.modal-card
width: 1200px
</style>
Not a prettiest solution, but it works. I also had to add z-index to .modal, as some parts of my html cover modal backdrop.
本文标签: javascriptunable to set buefy modal widthStack Overflow
版权声明:本文标题:javascript - unable to set buefy modal width - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745440217a2658413.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论