引入jquery:css
1.在cmd輸入:npm install jquery,回車,等待..html
2.在webpack.base.conf.js裏進行以下操做:vue
3.在webpack.prod.conf.js裏進行以下操做:jquery
4.在入口文件裏引入:webpack
不知道是否是jquery版本的問題,在重構之前寫的頁面時,經過在.vue文件裏引入js的方式將寫好的js引入(該js文件裏用了jquery插件),部分功能有問題web
引入bootstrapnpm
參照網上的方式進行了實踐,生效了。bootstrap
主要在配置文件裏添加了兩個配置文件,這個兩個文件必定要放在一塊兒less
1.bootstrap.config.js文件:jquery插件
module.exports = {
// Default for the style loading
styleLoader: require('extract-text-webpack-plugin').extract('style-loader', 'css-loader!postcss-loader!less-loader'),
scripts: {
'transition': true,
'alert': true,
'button': true,
'carousel': true,
'collapse': true,
'dropdown': true,
'modal': true,
'tooltip': true,
'popover': true,
'scrollspy': true,
'tab': true,
'affix': true
},
styles: {
"mixins": true,
"normalize": true,
"print": true,
"scaffolding": true,
"type": true,
"code": true,
"grid": true,
"tables": true,
"forms": true,
"buttons": true,
"component-animations": true,
"glyphicons": true,
"dropdowns": true,
"button-groups": true,
"input-groups": true,
"navs": true,
"navbar": true,
"breadcrumbs": true,
"pagination": true,
"pager": true,
"labels": true,
"badges": true,
"jumbotron": true,
"thumbnails": true,
"alerts": true,
"progress-bars": true,
"media": true,
"list-group": true,
"panels": true,
"wells": true,
"close": true,
"modals": true,
"tooltip": true,
"popovers": true,
"carousel": true,
"utilities": true,
"responsive-utilities": true
}
};
2.bootstrap.strap.config.less文件(聽說空的也行,沒試過):
@font-size-base: 24px;
@btn-default-color: #444;
@btn-default-bg: #eee;
3.在入口文件經過import '/path/bootstrap.min.js'的方式引入;
4.bootstrap樣式能夠採起上述方式引入或者在index.html裏引入;
5.其餘插件也可經過import方式引入,但部分插件可能會出現問題,解決方案自行google