<template>
<div>
<!-- 使用 BootstrapVue3 的按钮组件 -->
<b-button variant="primary">点击我</b-button>
</div>
</template>
<script>
// 引入 BootstrapVue3 和 Vue3 相关的依赖
import { BButton } from 'bootstrap-vue-3';
import { defineComponent } from 'vue';
export default defineComponent({
components: {
BButton, // 注册按钮组件
},
});
</script>
<style>
/* 可以在这里引入 Bootstrap CSS */
@import 'bootstrap/dist/css/bootstrap.css';
@import 'bootstrap-vue-3/dist/bootstrap-vue-3.css';
</style>
模板部分 (<template>):
b-button 组件,这是来自 BootstrapVue3 的按钮组件。variant="primary" 设置了按钮的样式为蓝色(主色调)。脚本部分 (<script>):
BButton 组件,并通过 components 选项注册该组件。defineComponent 来定义 Vue 组件,这是一种推荐的方式来定义 Vue 3 组件。样式部分 (<style>):
如果你需要更多功能或组件,请参考 BootstrapVue3 官方文档。
上一篇:vue在线编辑
下一篇:vue withdefaults
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站