標籤:als 重構 樣式 外掛程式 page 解決方案 str pager require
引入jquery:
1.在cmd輸入:npm install jquery,斷行符號,等待..
2.在webpack.base.conf.js裡進行如下操作:
3.在webpack.prod.conf.js裡進行如下操作:
4.在入口檔案裡引入:
不知道是不是jquery版本的問題,在重構以前寫的頁面時,通過在.vue檔案裡引入js的方式將寫好的js引入(該js檔案裡用了jquery外掛程式),部分功能有問題
引入bootstrap
參照網上的方式進行了實踐,生效了。
主要在設定檔裡添加了兩個設定檔,這個兩個檔案一定要放在一起
1.bootstrap.config.js檔案:
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
腳手架搭建的vue項目裡引入jquery和bootstrap