How to introduce bootstrap elementUI and echarts into Vue project
- 2021-10-11 17:24:59
- OfStack
Introducing bootstrap
Install dependency packages
cnpm install bootstrap --save-dev
cnpm install jquery --save-dev
cnpm install popper.js --save-dev
Global introduction
Add the following code to main. js in the root directory of the project:
import 'bootstrap'
import $ from 'jquery'
Reference in vue file
< script >
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
< /script >
Introducing elementUI
Installing elementUI
Open the terminal and enter the following
npm i element-ui -S
Global introduction
Add the following code to main. js in the root directory of the project:
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI)
Introducing echarts
Installing echarts
npm install echarts -S
2. Global introduction of main. js
//Introducing echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts