ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.65k stars 1.48k forks source link

不注册@vue/composition-api无法使用 #688

Closed chinesecooly closed 1 year ago

chinesecooly commented 1 year ago

请确认

您是如何将 Vue-ECharts 引入项目的?

通过 ES 模块 import

版本信息

+-- echarts@5.4.0
+-- vue@2.6.12
+-- vue-echarts@6.2.3
`-- vue-json-editor@1.4.3
  `-- vue@2.6.12  deduped

问题详情

如果不在我的项目中使用以下代码进行@vue/composition-api的注册

import Vue from 'vue' import VueCompositionAPI from '@vue/composition-api' Vue.use(VueCompositionAPI)

那么图表将不显示且出现以下错误

[Vue warn]: createElement() has been called outside of render function.

问题复现

与vue2模板一致

Justineo commented 1 year ago

要在 vue@2.7.0 之前的版本中使用 Vue-ECharts,必须安装 @vue/composition-api

https://github.com/ecomfe/vue-echarts/blob/main/README.zh-Hans.md#vue-2-%E6%94%AF%E6%8C%81