Does this library work with composition-api?
How do I make it work?
The composition-api was introduce in Vue 3.0 and isn't currently supported.
👆
Yeah this.
@apertureless Any plans for Vue 3 support?
If I find the time, yes :D
@apertureless would it perhaps be possible to please make a sticky of this or another issue stating Vue 3 support please? It will probably be one of the most searched issues for those wanting to upgrade.
+1
I wanted to upgrade my application to Vue 3, but I found that vue-chartjs
is not yet working with Vue 3. My rough and hacky solution is contained in the vue-chartjs
fork here: https://github.com/davidrunger/vue-chartjs/pull/1 (_Fix Vue 3 compatibility_).
If you are using yarn
, you can direct your application to install vue-chartjs
from that fork/branch via:
yarn add https://github.com/davidrunger/vue-chartjs.git\#vue-3
For me, no changes to my application code were necessary other than that command (which updates package.json
and yarn.lock
).
In case you're curious about some of the details, I added some comments on that pull request (link again) explaining why I made the particular changes that I did. Happily, I didn't need to make very many changes to vue-chartjs
in order to get it working with Vue 3 in my application.
I cannot guarantee that my branch will solve all Vue 3 compatibility issues for all applications; I made no effort to update all relevant parts of vue-chartjs
for Vue 3, but rather I only fixed the particular things that were breaking in vue-chartjs
as used by my particular application when using Vue 3. My application doesn't use vue-chartjs
too extensively, so there are probably other things that should/must be updated in vue-chartjs
in order to achieve full Vue 3 compatibility in all cases / for all applications. Nevertheless, I did want to share my work here, in case it's of any use to others in its current rough form as a fork and/or in case it's helpful to @apertureless (or other contributors) in the effort to update the official version of this package for Vue 3 compatibility.
Most helpful comment
If I find the time, yes :D