本文摘自PHP中文网,作者angryTom,侵删。
如果你想了解更多关于bootstrap的知识,可以点击:bootstrap教程
一、引入jquery
步骤:
1、安装jquery
1 | $ npm install jquery --save-dev
|
2、在webpack.config.js 添加内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + const webpack = require("webpack");
module.exports = {
entry: './index.js',
output: {
path: path.join(__dirname, './dist'),
publicPath: '/dist/',
filename: 'index.js'
},
+ plugins: [
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery'
})
]
}
|
3、在入口文件index.js 里面添加内容
4、测试一下是否安装成功,看看能否弹出'123'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | < template >
< div >
Hello world!
</ div >
</ template >
< script >
$(function () {
alert(123);
});
export default {
};
</ script >
< style >
</ style >
|
二、引入Bootstrap
1、安装Bootstrap
1 | $ npm install --save-dev bootstrap
|
2、在入口文件index.js里引入相关
1 2 | import './node_modules/bootstrap/dist/css/bootstrap.min.css' ;
import './node_modules/bootstrap/dist/js/bootstrap.min.js' ;
|
3、添加一段Bootstrap代码
1 2 3 4 5 | < div class = "btn-group" role = "group" aria-label = "..." >
< button type = "button" class = "btn btn-default" >Left</ button >
< button type = "button" class = "btn btn-default" >Middle</ button >
< button type = "button" class = "btn btn-default" >Right</ button >
</ div >
|
4.运行,查看效果 这些按钮已经变成Bootstrap按钮组了
以上就是vue能用bootstrap吗的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
vue中怎么引入bootstrap
简述为什么要使用bootstrap,有什么优点
bootstrap 如何取消自适应
bootstrap有什么ui框架?
vue和react能做什么
bootstrap是响应式的吗
vue.use中发生了什么
如何替换bootstrap中的样式
详解vue中的无渲染行为插槽
bootstrap如何设置页面回到顶端悬停提示
更多相关阅读请进入《vue》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » vue能用bootstrap吗