-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR issue with the ChartPie #6
Comments
Hey, There is no need to do So you can import the components like: import { ChartPie } from 'vue-d2b' And then register them in the vue instance like: export default {
components: {
ChartAxis
}
} You can refer here for more specifics on rendering the vue d2b pie chart: http://docs.d2bjs.org/vue-d2b/#/pie |
One more not on this you can also register the component globally by doing: import { ChartPie } from 'vue-d2b'
Vue.component('chart-axis', ChartAxis) |
Thanks @kevinwarne, In the dev environment, I am facing the below error as I attached. |
Hmm, I haven't used vue-d2b with a SSR implementation yet. But I think I'm beginning to see the problem. With nuxt you can escape from ssr rendering with the <no-ssr>
<chart-pie></chart-pie>
</no-ssr> One more post related to your specific error is here vuejs-templates/webpack#215. Since vue-d2b does have some javascript included templates I've gone ahead moved it all to Cheers |
Thanks, @kevinwarne. I updated my code And it works perfectly. |
Good to hear! I'll close this now. |
I know this is closed and not related to vue-d2b, but to make it easy for future viewers as this was a Nuxt issue, if you're using nuxt >v2.9.0 use client-only instead of no-ssr. https://nuxtjs.org/api/components-client-only/ |
Hi,
I am using vue-d2b for my project to show the PieChart. I my plugin folder i am loading the code is
I already registered my plugin also in nuxt.config.js like
But i am still facing the issue of " Unknown custom element: - did you register the component correctly" in the console.
Any suggestion for this.
Thanks
The text was updated successfully, but these errors were encountered: