四时宝库

程序员的知识宝库

编程资源介绍之BootstrapVue(bootstrap源码)

介绍

Bootstrap是Twitter推出的一个用于前端开发的开源工具包。它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架。

Vue 是一套用于构建用户界面的渐进式框架

而两者的合体就是BootstrapVue,一个基于Vue.js 和Bootstrap v4开发的框架。

官网

https://bootstrap-vue.org/

安装使用

# With npm
npm install bootstrap-vue

# With yarn
yarn add bootstrap-vue

例子

vue

<div>

<b-button size="sm" @click="toggle">

{{ show ? 'Hide' : 'Show' }} Alert

</b-button>

<b-alert

v-model="show"

class="mt-3"

dismissible

@dismissed="dismissed"

>

Hello {{ name }}!

</b-alert>

</div>

javascript

{

data() {

return {

name: 'BootstrapVue',

show: true

}

},

watch: {

show(newVal) {

console.log('Alert is now ' + (newVal ? 'visible' : 'hidden'))

}

},

methods: {

toggle() {

console.log('Toggle button clicked')

this.show = !this.show

},

dismissed() {

console.log('Alert dismissed')

}

}

}

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言
    友情链接