脑子不好,每次引入都要重新搜一遍,今天把几个自己整理一下。全部引入,没搞按需引入。
1.vue项目引入elementui
控制台输入npm install element-ui -s
main.js文件中输入
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
2.vue项目中引入iview
控制台输入npm install iview -s
import iView from 'iview' // 引入ivew库
import 'iview/dist/styles/iview.css' // 使用CSS
Vue.use(iView)
3.vue项目中引入echarts
控制台输入npm install echarts -s
import * as echarts from 'echarts' // 导入echarts
Vue.prototype.$echarts = echarts // 并设置对应的属性
4.main.js文件代码截图
5.echarts在引入之后,需要使用echarts的页面,还需要import一下
<script>
import * as echarts from 'echarts'
</script>
6.引入之后就可以使用他们的组件了。