浅时光吖~  
生活明朗,万物可爱,加油~
<template>
    <view class="content">
     <!-- 引入的mpvue-echarts组件 -->
     <uni-echarts class="ec-canvas" id="line-chart" ref="canvas" canvas-id="line-chart" :ec="echart"></uni-echarts>
   </view>
<template>

<script>
//import引入组件 import uniEcharts from '@/components/uni-echarts/uni-echarts'; export default { data() { return { //echart图表参数   echart: {     option: {     ......这里是echart参数     }   } }, methods: { // 重新渲染echart并且赋值 reloadEchart(data){   const option = this.echart.option;   option.series[0].data = data;   if(this.$refs['canvas']){     this.$refs['canvas'].updateOption(option); //赋值option },
//注册组件 components: {   uniEcharts } }
</script>

 

uniEcharts在components文件夹下:

 

 

 

posted on 2020-07-22 18:23  浅时光吖~  阅读(9620)  评论(0编辑  收藏  举报