1.1.0 • Published 2 months ago
zcc-uniapp-echarts v1.1.0
uniapp 使用 echarts 的封装 app 和 h5,uniapp 小程序可用
安装
npm i zcc-uniapp-echarts
配置 PC 和 APP
全局引入
import echart from "zcc-uniapp-echarts";
Vue.use(echart);
局部引入
import echart from "zcc-uniapp-echarts/components";
components: {
echart;
}
复制 echarts 到项目静态目录下
cp ./node_modules/zcc-uniapp-echarts/models/echarts.min.js ./static
使用
<echart :option="options" style="height: 400px;"></echart>
配置小程序
修改 pages.json 加入,这个配置了需要重新编译才能起效果
"easycom": {
"echart":"zcc-uniapp-echarts/components/weIndex"
},
使用
<view style="height: 400px;width: 100%;">
<echart :option="options" ></echart>
</view>