BootstrapVue 是一个基于 Bootstrap 的 Vue.js UI 框架,它提供了一组可重用的 Vue 组件,使得开发基于 Bootstrap 的 Vue 应用更加容易。
安装 BootstrapVue
您可以通过 npm 或 yarn 来安装 BootstrapVue:
npm install bootstrap-vue
或者
yarn add bootstrap-vue
示例组件
以下是一个使用 BootstrapVue 的组件示例:
<template>
<b-container>
<b-row>
<b-col cols="12" md="6" lg="4">
<b-card title="Card Title" sub-title="Card Sub Title">
<b-card-text>
Some quick example text to build on the card title and make up the bulk of the card's content.
</b-card-text>
<b-button href="#" variant="primary">Go somewhere</b-button>
</b-card>
</b-col>
</b-row>
</b-container>
</template>
<script>
import { BContainer, BRow, BCol, BCard, BCardTitle, BCardSubTitle, BCardText, BButton } from 'bootstrap-vue'
export default {
components: {
BContainer,
BRow,
BCol,
BCard,
BCardTitle,
BCardSubTitle,
BCardText,
BButton
}
}
</script>
扩展阅读
更多关于 BootstrapVue 的信息和教程,请访问我们的官方文档:BootstrapVue 官方文档