如何在vue2.0项目中引用element-ui和echart.js

1 项目中怎样添加elment-ui 和 echart.js

  1.1直接在packjson 里面的 dependencies 配置

  "element-ui": "^1.3.3",

  "echarts": "^3.5.3",

  然后在npm install

  或者直接npm install element-ui --savenpm install echarts --save

2 如何用element-ui和echarts

  2.1 elemnt-ui只需在main.js里添加

  import ElementUI from 'element-ui'

  import 'element-ui/lib/theme-default/index.css'

  Vue.use(ElementUI);

  2.2 对于用到echart的页面,哪个页面用到就在哪个页面引import echarts from "echarts"

3  图片上传在element-ui中使用图片上传插件选择照片墙

  若想回选展示图片,可使用file-list属性(值为数组,其初始化值也必须是数组哦)。其中图片展示的图片路径参数必须是url,其它参数不做要求。

原文地址:https://www.cnblogs.com/nanacln/p/6856476.html