You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,11 @@ However you can simply implement this on your own or use one of the two mixins w
165
165
Both are included in the `mixins` module.
166
166
167
167
The mixins automatically create `chartData` as a prop or data. And add a watcher. If data has changed, the chart will update.
168
-
However keep in mind the limitations of vue and javascript for mutations on arrays and objects. More info [here](http://vue-chartjs.org/#/home?id=reactive-data)
168
+
However keep in mind the limitations of vue and javascript for mutations on arrays and objects.
169
+
**It is important that you pass your options in a local variable named `options`!**
170
+
The reason is that if the mixin re-renders the chart it calls `this.renderChart(this.chartData, this.options`)` so don't pass in the options object directly or it will be ignored.
171
+
172
+
More info [here](http://vue-chartjs.org/#/home?id=reactive-data)
169
173
170
174
```javascript
171
175
// MonthlyIncome.js
@@ -229,6 +233,10 @@ export default {
229
233
}
230
234
```
231
235
236
+
## Single File Components
237
+
238
+
You can create your components in Vues single file components. However it is important that you **do not** have the `<template></template>` included. Because Vue can't merge tempaltes. And the template is included in the mixin. If you leave the template tag in your component, it will overwrite the one which comes from the base chart and you will have a blank screen.
0 commit comments