highcharts-vue icon indicating copy to clipboard operation
highcharts-vue copied to clipboard

Vue 3 compatibility

Open Sadga opened this issue 5 years ago • 10 comments

Hello, i tried using the module with vue 3 but it doesn't seem to work, i am on the latest version (1.3.5 from npm), tried both local and global registration but with the same result.

Is there anything i can do or do i need to wait for a compatible version of the module?

Kind regards.

Sadga avatar Oct 05 '20 15:10 Sadga

Hi, i "solved" the problem using the standard version of Highcharts imported from the html files.

Sadga avatar Oct 06 '20 09:10 Sadga

Hello @Sadga ,

Thank you for reporting the problem. For now, the wrapper is intended to use with Vue v2.x, and I'm not able to specify any ETA of when it will be refactored to support Vue v3. I'm adding the Enhancement label for this issue, so please check for the updates here from time to time, or just watch the topic to get notification.

Kind regards!

Denyllon avatar Oct 08 '20 08:10 Denyllon

Hi, i "solved" the problem using the standard version of Highcharts imported from the html files.

@Sadga Any chance you could share a code sample of how you made it work?

Thanks!

beau-gosse avatar Dec 31 '20 00:12 beau-gosse

@beau-gosse @Sadga probably meant using the highcharts directly within HTML by linking the library through <script> tag, and completely omit the wrapper package.

Denyllon avatar Jan 04 '21 09:01 Denyllon

Yes, as @Denyllon said you can include the standard library in the htm with the <script> tag, then you can use Highcharts.chart(...) in like the mounted method (or where you need it).

Sadga avatar Jan 04 '21 14:01 Sadga

@Sadga @Denyllon thanks for the follow-up! Will definitely give it a go.

beau-gosse avatar Jan 06 '21 15:01 beau-gosse

https://github.com/highcharts/highcharts-vue/pull/180

dmitrystas avatar Feb 09 '21 10:02 dmitrystas

Hi, I started an ionic vuejs 3 project ionic vuejs highcharts @dmitrystas I have installed your patch via npm, but still not rendered and got some warns.

[Vue warn]: `beforeDestroy` has been renamed to `beforeUnmount`. 
  at <Anonymous options= 
Object { title: {…}, subtitle: {…}, xAxis: {…}, yAxis: {…}, series: (1) […] }
 > 
  at <Anonymous fullscreen=true > 
  at <IonPage isInOutlet=true registerIonPage=fn<registerIonPage> > 
  at <Home ref=Ref< undefined > key="/home" isInOutlet=true  ... > 
  at <IonRouterOutlet> 
  at <IonApp> 
  at <App> runtime-core.esm-bundler.js:38

[Vue warn]: Unhandled error during execution of render function 
  at <Anonymous options= 
Object { title: {…}, subtitle: {…}, xAxis: {…}, yAxis: {…}, series: (1) […] }
 > 
  at <Anonymous fullscreen=true > 
  at <IonPage isInOutlet=true registerIonPage=fn<registerIonPage> > 
  at <Home ref=Ref< undefined > key="/home" isInOutlet=true  ... > 
  at <IonRouterOutlet> 
  at <IonApp> 
  at <App>
Uncaught (in promise) TypeError: t is not a function
    render VueJS
    renderComponentRoot runtime-core.esm-bundler.js:710
[...]

My app use dist/highcharts-vue.min.js so I change beforeDestroy:function(){this.chart&&this.chart.destroy()}}}; to beforeUnmount:function(){this.chart&&this.chart.destroy()}}}; and first warn leave, still the other ones. What other changes we have to do ? Thanks.

norecords avatar Feb 18 '21 09:02 norecords

Hi @norecords ,

Thank you for letting us know about the issue. The PR which is responsible for adding Vue 3 support have been waiting for review and merge. It should be done in a few days, so after that, the next released version will most probably resolve the issues described above.

Kind regards!

Denyllon avatar Feb 18 '21 10:02 Denyllon

hi @Denyllon , Thank you for your answer, that so nice to use these libraries and frameworks together!

Best Regards.

norecords avatar Feb 18 '21 20:02 norecords

Closing as highcharts-vue offers support for Vue3 with Composition API since version 1.4.2. Here's a demo: https://codesandbox.io/s/cool-shannon-qvrir6

jszuminski avatar Jun 05 '23 11:06 jszuminski