0

I installed vue-chartjs and also added chart.js both using NPM

When I run npm start my server is started but in broswer console i get an error

TypeError: __WEBPACK_IMPORTED_MODULE_0_vue_chartjs__.Doughnut.extend is not a function

I'm not sure what this mean. I reinstalled all packages also installed this packages separete using npm install vue-chartjs

4

1 回答 1

0

你能展示你的组件代码吗?网络包 3 ? 使用 vue-chartjs 版本 3,您必须以这种方式创建组件:

import {Doughnut} from 'vue-chartjs

export default {
   extends: Doughnut,
   mounted () {
     this.renderChart(data, options)
   }
}
于 2017-10-15T09:24:28.970 回答