We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The Base Charts are using the Vue.extend() which creates a subclass of the base vue constructor.
This way if you create your own components, you can extend the base component.
extend
import {Line} from 'vue-chartjs' export default Line.extend({ mounted () { this.renderChart(data, options) } })
I really liked the concept back then ( Jun 2016 first commit 😄 ). However it creates a lot of confusion to people new to Vue.js
And it is not really nessasary.
To clean up the API and usage the Vue.extend() should be removed. And extending the base component should be done with either extends or mixins
Vue.extend()
This way, your component would look like this:
import {Line} from 'vue-chartjs' export default { extends: Line, mounted () { this.renderChart(data, options) } }
or
import {Line} from 'vue-chartjs' export default { mixins: [Line], mounted () { this.renderChart(data, options) } }
This way own components would be standard vue component style. It is a breaking change, but without much efford to fix.
Scheduled for v3
v3
Another benefit would be the decreased size, as the old version needs the base vue constructor, and bundle vue into it.
yarn add vue-chartjs@next
The text was updated successfully, but these errors were encountered:
May I take this one @apertureless ?
Sorry, something went wrong.
Hey @kimuraz
well it's already done. https://github.com/apertureless/vue-chartjs/tree/feature/v3
But needs some testing and I need to update the docs. Thats why this issue is still open.
That's ok, if I can be useful in any of these tasks, let me know.
I can also update the docs translation (pt-br) for the new version. Is it ok?
this change is so cool
its cool...
apertureless
No branches or pull requests
Current state
The Base Charts are using the Vue.extend() which creates a subclass of the base vue constructor.
This way if you create your own components, you can
extend
the base component.I really liked the concept back then ( Jun 2016 first commit 😄 ). However it creates a lot of confusion to people new to Vue.js
And it is not really nessasary.
Proposal
To clean up the API and usage the
Vue.extend()
should be removed. And extending the base component should be done with either extends or mixinsThis way, your component would look like this:
or
This way own components would be standard vue component style.
It is a breaking change, but without much efford to fix.
Scheduled for
v3
Another benefit would be the decreased size, as the old version needs the base vue constructor, and bundle vue into it.
Todo
Vue.extend()
Testing
yarn add vue-chartjs@next
The text was updated successfully, but these errors were encountered: