Rewrite template option to render function

This commit is contained in:
Jakub Juszczak
2016-12-20 14:36:35 +01:00
parent e4ba9ea5a3
commit bb21a40506
8 changed files with 131 additions and 37 deletions

View File

@@ -3,11 +3,23 @@ import Chart from 'chart.js'
import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
render: function (createElement) {
return createElement(
'div',
[
createElement(
'canvas', {
attrs: {
id: this.chartId,
width: this.width,
height: this.height
},
ref: 'canvas'
}
)
]
)
},
props: {
chartId: {