chore(examples): Update reactive prop examples

This commit is contained in:
Jakub Juszczak
2018-01-12 13:52:45 +01:00
parent 75bfa5ccbc
commit ecae747ba3
2 changed files with 14 additions and 6 deletions

View File

@@ -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()

View File

@@ -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)
}
}