Skip to content

Commit

Permalink
chore(examples): Update reactive prop examples
Browse files Browse the repository at this point in the history
  • Loading branch information
apertureless committed Jan 12, 2018
1 parent 75bfa5c commit ecae747
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/examples/ReactiveExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import reactiveData from '../mixins/reactiveData'
export default {
extends: Bar,
mixins: [reactiveData],
data () {
return {
chartData: ''
data: () => ({
chartData: '',
options: {
responsive: true,
maintainAspectRatio: false
}
},
}),
created () {
this.fillData()
},

mounted () {
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
this.renderChart(this.chartData, this.options)

setInterval(() => {
this.fillData()
Expand Down
8 changes: 7 additions & 1 deletion src/examples/ReactivePropExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ import reactiveProp from '../mixins/reactiveProp'
export default {
extends: Bar,
mixins: [reactiveProp],
data: () => ({
options: {
responsive: true,
maintainAspectRatio: false
}
}),

mounted () {
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
this.renderChart(this.chartData, this.options)
}
}

0 comments on commit ecae747

Please sign in to comment.