在vue里面使用echarts提示template or render function not defined

在vue2.6.10的项目里面使用echarts4.2.1版本提示Failed to mount component: template or render function not defined
请问如何解决呢?
我是以

import echarts from 'echarts/lib/echarts'
import 'echarts/lib/chart/pie'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/toolbox'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title'

mounted () {
    this.loadBarChart()
  },
  methods: {
    /**
     * 加载数据
     */
    loadBarChart () {
      this.pieSystem = echarts.init(document.getElementById('pieSystemSuccess_main'), 'walden')
      this.pieSystem.setOption({
        title: {
          text: '系统成功率',
          subtext: '纯属虚构'
        },
        tooltip: {
          trigger: 'item',
          formatter: '{b}: {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          x: 'left',
          top: '50',
          data: this.systemList.forEach((item) => { return item.reason })
        },
        series: {
          name: '数据详情',
          type: 'pie',
          radius: ['0', '55%'],
          data: this.$releaseEchartsData(this.systemList, 'system', 'number')
        }
      })
      const data = {
        nameStr: 'pieSystemProp',
        data: this.pieSystem
      }
      this.$emit('releaseEchartsComponents', data)
    }
  }

这种形式来进行使用的,请问如何解决这个警告呢?

阅读 3.1k
1 个回答

你既没有写template,也没有在js里面写render,怎么可能不报错

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题