Merge Vue-ECharts and Nuxt ECharts #811
kingyue737
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Can you elaborate on this further? Is it because of Nuxt itself?
Is it possible to create a
Initially I even think people can just do |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@Justineo Firstly thank you very much for creating this awesome Vue component, nearly all of my projects depend on Vue-ECharts. When I initiated Nuxt ECharts, I copied code from Vue-ECharts instead of importing it because Vue-ECharts did not have an ESM entry recognized by Node at that time and I also wanted to drop
resize-detector
andvue-demi
since Nuxt 2 does not have Server Component and has already reached EOL.With the release of v7, I think it may be possible to import Vue-ECharts as a dependency of Nuxt ECharts. I took a try in kingyue737/nuxt-echarts#4. Here are some patches to make Nuxt ECharts work properly:
<VChart>
will be added as a Client-only component (then it can be paired with a Server-only component). The problem is that Client-only components are rendered only after being mounted. To access the rendered template, we must add await nextTick() in the callback of the onMounted() hook.init
since we can't access theroot
insetup
, which means revert fix: move events collecting from init to setup #779. We can still makenative:
events work by turningnativeListeners
to aref
:#build/echarts.mjs
imported by<VChart>
. Thus, this virtual module will only be imported ifVChart
is imported. Now if we switch toVChart
fromvue-echarts
, how to achieve a similar effect? Injectimport '#build/echarts.mjs'
toVChart
via a rollup/webpack plugin?For further merging, do you mean we could move
nuxt-echarts
to the monorepo ofvue-echarts
?Beta Was this translation helpful? Give feedback.
All reactions