Skip to content
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

$attrs and $listeners are read only? #221

Closed
emjimadhu opened this issue Oct 11, 2017 · 3 comments
Closed

$attrs and $listeners are read only? #221

emjimadhu opened this issue Oct 11, 2017 · 3 comments

Comments

@emjimadhu
Copy link

emjimadhu commented Oct 11, 2017

What do i have now?

i created two components, one is for Horizontal Bar and Pie Chart.

I used those two components in a parent component. Now, parent component has Two Horizontal Bar and One Pie Chart.

Expected Behavior

It should show two horizontal bar and a Pie Chart.

Actual Behavior

When i mutate the values for charts. It gives me this error,

[Vue warn]: $attrs is readonly. emjimadhu/project/node_modules/vue/dist/vue.runtime.common.js:474 found in <HorizontalBar>

[Vue warn]: $listerners is readonly. emjimadhu/project/node_modules/vue/dist/vue.runtime.common.js:474 found in <HorizontalBar>

[Vue warn]: $attrs is readonly. emjimadhu/project/node_modules/vue/dist/vue.runtime.common.js:474 found in <PieChart>

[Vue warn]: $listerners is readonly. emjimadhu/project/node_modules/vue/dist/vue.runtime.common.js:474 found in <PieChart>

at first charts are empty. but when i reload the page, it shows the charts but with the same error.

PS

so what i noticed now was that error comes when all charts are visible.. i applied v-if to those charts div and if i open one at time, the error is not coming.

Environment

  • vue.js version: 2.4.4
  • vue-chart.js version: 2.8.7
  • npm version: 5.4.2
@apertureless
Copy link
Owner

I guess it is related to this #216 #151

Try to make your component this way:

import {Line} from 'vue-chartjs'

export default {
  extends: Line,
  data () {...}
}

@jesus143
Copy link

jesus143 commented Feb 26, 2018

Hi @apertureless, I have same problem and it works for me, Thanks!

import {Line} from 'vue-chartjs'

export default {
extends: Line
}

@apertureless
Copy link
Owner

@jesus143

Well, with v3 of vue-chartjs this is also the only way to create your chart component.
Either extends: Line or mixins: [Line]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants