【发布时间】:2019-06-11 20:27:48
【问题描述】:
我为 VueJS 使用 bootstrap v4,我需要增加 b-modal。 我尝试了这里提到的不同方法:https://github.com/bootstrap-vue/bootstrap-vue/issues/632 但没有任何帮助。 一般来说,我的代码看起来像:
<b-modal :ref="fieldName" :id="fieldName" :title="msg" size="lg" modal-class="b-modal">
<div class="script_table_container" v-if="scripts.length > 0">
<b-table :items="scripts" per-page="10" :current-page="currentPage">
<template slot="propertySnippet" slot-scope="data">
<samp>
{{data.value}}
</samp>
</template>
</b-table>
<b-pagination :total-rows="scripts.length" per-page="10" v-model="currentPage" hide-goto-end-buttons align="right"/>
</div>
<div slot="modal-footer">
<b-btn class="mr-sm-2 su-btn-link" @click="close">Close</b-btn>
</div>
</b-modal>
我需要将宽度增加到屏幕的 80-90%,因为表格中的某些值很长。
希望能得到你们的帮助。我相信你是大师。
附:答案已经找到了。 要对某些 b 模态应用更改,您可以执行下一步:
我在全球范围内创建:
@media (min-width: 992px) {
.modal .modal-huge {
max-width: 90% !important;
width: 90% !important;;
}
}
然后我将“巨大”放入 b-modal 的 size 属性中。之所以使用“巨大”,是因为该类以“巨大”一词结尾。
【问题讨论】:
标签: html css vue.js bootstrap-4 bootstrap-modal