Skip to content

Commit ecae747

Browse files
committed
chore(examples): Update reactive prop examples
1 parent 75bfa5c commit ecae747

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/examples/ReactiveExample.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ import reactiveData from '../mixins/reactiveData'
44
export default {
55
extends: Bar,
66
mixins: [reactiveData],
7-
data () {
8-
return {
9-
chartData: ''
7+
data: () => ({
8+
chartData: '',
9+
options: {
10+
responsive: true,
11+
maintainAspectRatio: false
1012
}
11-
},
13+
}),
1214
created () {
1315
this.fillData()
1416
},
1517

1618
mounted () {
17-
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
19+
this.renderChart(this.chartData, this.options)
1820

1921
setInterval(() => {
2022
this.fillData()

src/examples/ReactivePropExample.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import reactiveProp from '../mixins/reactiveProp'
44
export default {
55
extends: Bar,
66
mixins: [reactiveProp],
7+
data: () => ({
8+
options: {
9+
responsive: true,
10+
maintainAspectRatio: false
11+
}
12+
}),
713

814
mounted () {
9-
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
15+
this.renderChart(this.chartData, this.options)
1016
}
1117
}

0 commit comments

Comments
 (0)