extends: Line,
props: ['chartdata', 'options'],
mounted () {
this.renderChart(this.chartdata, this.options...它扩展了图表组件的逻辑, 并自动创建名为 chartData 的props参数, 并为这个参数添加vue watch.....
// 如果你需要替换 options , 请创建本地的 options 对象
this.renderChart(this.chartData, this.options)
}
}...如果 mixin 渲染一个新的图表, 它将调用this.renderChart(this.chartData, this.options)....全局插件在没有 vue-chartjs也可以工作. 就像这个文档Chart.js docs 描述的.