Vue引入ElementUI、Bootstrap等

1、创建工程

vue init webpack 工程名称

https://www.jianshu.com/p/02b12c600c7b

 

2、加入element-ui

yarn add element-ui

main.js中加入

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

 

3、加入bootstrap

yarn add bootstrap@3

yarn add jquery

main.js添加

import $ from 'jquery'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'

build/webpack.base.conf.js添加

var webpack = require('webpack')

// 增加一个plugins
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],

https://www.liangzl.com/get-article-detail-144453.html
posted @ 2020-04-21 09:24  weizhxa  阅读(1081)  评论(0编辑  收藏  举报