您的位置:首頁技術文章
文章詳情頁

Vue項目如何引入bootstrap、elementUI、echarts

瀏覽:73日期:2022-10-23 14:36:27

引入bootstrap

安裝依賴包

cnpm install bootstrap --save-devcnpm install jquery --save-devcnpm install popper.js --save-dev

全局引入

在項目中根目錄下的main.js中添加如下代碼:

import ’bootstrap’import $ from ’jquery’

在vue文件中引用

<script>import ’bootstrap/dist/css/bootstrap.min.css’import ’bootstrap/dist/js/bootstrap.min.js’</script>

引入elementUI

安裝 elementUI

打開終端,輸入以下內容

npm i element-ui -S

全局引入

在項目中根目錄下的main.js中添加如下代碼:

import ElementUI from ’element-ui’import ’element-ui/lib/theme-chalk/index.css’;Vue.use(ElementUI)

引入echarts

安裝echarts

npm install echarts -S

2.全局引入main.js

// 引入echartsimport echarts from ’echarts’Vue.prototype.$echarts = echarts

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Vue
相關文章:
国产综合久久一区二区三区