欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

利用纯Vue.js构建Bootstrap组件

程序员文章站 2023-11-21 15:00:52
没有jquery, bootstrap.js, 或不需要任何第三方插件。 this repository contains a set of native vue.js...

没有jquery, bootstrap.js, 或不需要任何第三方插件。

this repository contains a set of native vue.js components based on bootstrap's markup and css. as a result no dependency on jquery or bootstrap's javascript is required. the only required dependencies are:

vue.js (required ^0.12, test with 0.12.10).
bootstrap css (required 3.x.x, test with 3.3.5). vuestrap doesn't depend on a very precise version of bootstrap. just pull the latest.

commonjs

$ npm install vue-strap

var alert = require('vue-strap/src/alert');
// or
var alert = require('vue-strap').alert;

new vue({
 components: {
 'alert': alert
 }
})

es6

$ npm install vue-strap

import alert from 'vue-strap/src/alert'
// or
import { alert } from 'vue-strap'

new vue({
 components: {
 alert
 }``
})

amd

$ bower install vue-strap

define(['vue-strap'], function(vuestrap) { var alert = vuestrap.alert; ... });

本文已被整理到了《vue.js前端组件学习教程》,欢迎大家学习阅读。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。