【发布时间】:2020-01-11 05:30:24
【问题描述】:
从 Vuetify 文档中可以看出:
Vuetify 网格深受Bootstrap grid 的启发。它是 通过使用一系列容器、行和列来集成 布局和对齐内容。
这是否意味着如果我在 Vuetify 项目中使用引导网格类,它会像使用 Vuetify 组件一样工作(例如 v-container、v-row 和 v-col)?
换句话说,如果我将基于引导程序的项目中的网格标记复制/粘贴到 Vuetify 项目(例如,在某些 .vue 组件中复制/粘贴到 template),它会正常工作吗?
基于my simple example that I did in this codepen,这似乎确实是这样,但我想问一个问题。
所以这段代码:
<!-- grid layout via Vuetify components -->
<v-container>
<v-row justify-content-between>
<v-col cols="2" class="my-col">One of three columns</v-col>
<v-col cols="5" class="my-col">One of three columns</v-col>
<v-col cols class="my-col">One of three columns</v-col>
</v-row>
</v-container>
<!-- grid layout via bootstrap classes -->
<div class="container">
<div class="row">
<div class="col-2 my-col">One of three columns</div>
<div class="col-5 my-col">One of three columns</div>
<div class="col my-col">One of three columns</div>
</div>
</div>
为两个容器生成相同的布局。
我无法对单个示例做出结论,所以我想知道这是否普遍适用?
注意:此问题适用于 Vuetify 版本 2 和 Bootstrap 版本 4。
【问题讨论】:
标签: css twitter-bootstrap vue.js bootstrap-4 vuetify.js