mirror of
				https://github.com/KevinMidboe/vue-chartjs.git
				synced 2025-10-29 18:00:20 +00:00 
			
		
		
		
	Rewrite template option to render function
This commit is contained in:
		@@ -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: {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user