css - 无法在模式页脚的 bootstrap-vue 列中居中选择列表和分页器
问题描述
我正在尝试在bootstrap-vue modal内的页脚范围插槽内对齐一些项目,并且由于某种原因,无论我尝试什么,我都无法将我的内容放在一个列中移动到右侧
<template #modal-footer="{ ok, cancel }">
<div class="row w-100">
<div class="col-9 text-right border border-primary">
<b-form inline class="d-flex">
<b-form-select class="justify-content-end"
v-model="perPage"
:options="pagerSelectOptions"
>
</b-form-select>
<b-pagination
v-model="currentPage"
:total-rows="totalRows"
:per-page="perPage"
size="md"
hide-goto-end-buttons
></b-pagination>
</b-form>
</div>
<div class="col-3 text-right border border-primary">
<b-button class="mr-4"
:disabled="restoreButtonDisabled"
dusk="deleted-pursuit-restore-ok-button"
variant="primary"
@click="restore"
>
<b-spinner
v-if="loading"
small
type="grow"
>
</b-spinner>
{{ restoreButtonText }} <b-badge
v-if="selectedPursuits.length > 0"
variant="outline-primary"
>{{ selectedPursuits.length }}
</b-badge>
</b-button>
<b-button
:disabled="loading"
@click="cancelModal"
dusk="deleted-pursuit-restore-cancel-button"
>
Cancel
</b-button>
</div>
</div>
</template>
我想要的只是在左栏中将选择和页面居中。我已经尝试了每个justify
变体和其他类选项,但我无法让这些项目让步。我需要做什么才能使项目在列中居中?
解决方案
我认为问题在于ul
in bootstrap-vue 分页有一个margin
覆盖以前的道具。您可以通过将分页设置margin
为 0(即m-0
引导方式)并手动将边距/填充应用于其他元素以使其看起来不错来解决此问题。所以,像这样:
<template #modal-footer="{ ok, cancel }">
<div class="row mx-2">
<div class="col-9 text-right border border-primary d-flex justify-content-center py-2">
<b-form inline>
<b-form-select class="justify-content-end"
v-model="perPage"
:options="pagerSelectOptions"
>
</b-form-select>
<b-pagination
class="m-0"
v-model="currentPage"
:total-rows="totalRows"
:per-page="perPage"
size="md"
hide-goto-end-buttons
></b-pagination>
</b-form>
</div>
<div class="col-3 text-right border border-primary border-left-0 py-2">
<b-button class=""
:disabled="restoreButtonDisabled"
dusk="deleted-pursuit-restore-ok-button"
variant="primary"
@click="restore"
>
<b-spinner
v-if="loading"
small
type="grow"
>
</b-spinner>
{{ restoreButtonText }}
<b-badge
v-if="selectedPursuits.length > 0"
variant="outline-primary"
>{{ selectedPursuits.length }}
</b-badge>
</b-button>
<b-button
:disabled="loading"
@click="cancelModal"
dusk="deleted-pursuit-restore-cancel-button"
>
Cancel
</b-button>
</div>
</div>
</template>
推荐阅读
- c# - 可使用 IHostedService 取消任务并从服务外部启动/停止
- javascript - 将 JSON 更改转换为事件的最佳方法
- javascript - 无法将 Javascript 源代码转换为 Python
- r - 给定 R 中另一个变量的条件,你能从一个变量中提取最小值吗?
- javascript - 更改标签时如何使javascript转换不停止
- actions-on-google - 智能媒体设备的谷歌操作中的频道特征
- sql - 如何在不包括经理工资的情况下找到每个经理下所有员工的工资总和?
- r - 如何编写加载时提示消息的R包?
- python - Kivy ~ AttributeError: 'TextInput' 对象没有属性 'replace'
- javascript - 基于键数组重新排列对象键 javascript