Skip to content

Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders #151

Closed
@afuno

Description

@afuno

Expected Behavior

The values in the chart should be changed without any errors.

I mean this code: http://vue-chartjs.org/#/home?id=reactive-data

Actual Behavior

The chart is initialized. The values are displayed. After pressing the button, the values change.

But in the logs of the browser, this errors always appears:

[Vue warn]: $attrs is readonly.

And second:

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "chartData"

My code is exactly the same as your code in the documentation. I did not specifically change it.

Environment

  • vue.js version: 2.4.1
  • vue-chart.js version: 2.7.1
  • npm version: 5.3.0 (but I use yarn)
  • yarn version: 0.27.5

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions