Vue項目如何引入bootstrap、elementUI、echarts
引入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
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關文章:
1. .NET中l(wèi)ambda表達式合并問題及解決方法2. JSP數(shù)據(jù)交互實現(xiàn)過程解析3. 淺談python出錯時traceback的解讀4. 利用promise及參數(shù)解構封裝ajax請求的方法5. Python importlib動態(tài)導入模塊實現(xiàn)代碼6. python matplotlib:plt.scatter() 大小和顏色參數(shù)詳解7. windows服務器使用IIS時thinkphp搜索中文無效問題8. ASP 信息提示函數(shù)并作返回或者轉向9. 在Android中使用WebSocket實現(xiàn)消息通信的方法詳解10. Nginx+php配置文件及原理解析
