-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
Compatibility with Vue 2.1.10 #30
Comments
Will look into it. |
Should be fixed now. |
Just updated and the problem persists. |
Can you post your component ? Are you using a build system ? Webpack1/2, Browserify etc ? |
Sure, this is the component: <script>
import { Line, reactiveProp } from 'vue-chartjs'
export default Line.extend({
data: function () {
return {}
},
props: {
chartData: {
type: Object
},
options: {
type: Object,
default: function () {
return {
animateScale: true,
responsive: true,
maintainAspectRatio: false,
scales: {
xAxes: [{
barThickness: 8,
categoryPercentage: 0.8,
barPercentage: 0.9
}]
},
title: {
display: false,
text: 'Custom Chart Title',
fontSize: 24
}
}
}
}
},
mixins: [reactiveProp],
mounted: function () {
if (this.chartData) {
this.renderChart(this.chartData, this.options)
}
}
})
</script> And yes, I am using Webpack 1.14 |
Ah gotcha. The problem is the mixin. Check this out: https://github.com/apertureless/vue-chartjs#reactivity You have to import { mixins } from 'vue-chartjs' and use it then as mixins: [mixins.reactiveProp] Or you can make a es6 destructive assign import { Line, mixins } from 'vue-chartjs' and use it then as reactiveProp. Also described in the release notes |
Great, problem fixed! I didn't notice the change of how to import the |
Expected Behavior
vue-chartjs
works withvue@2.1.10
.Actual Behavior
Running
vue-chartjs@2.3.2
withvue@2.1.10
results in the application crashing withUncaught TypeError: Cannot read property 'prototype' of undefined
. Rolling back tovue-chartjs@2.2.0
prevents the crash, but the charts are not being rendered.Complete error stack:
Environment
Thanks for the support!
The text was updated successfully, but these errors were encountered: