我有一个使用 Webpack 的 Vue JS 项目,需要导入 Chart.js.我试过了
I have a Vue JS project using Webpack and need to import Chart.js. I have tried
// import Chart from 'chart.js/Chart.min.js'
这会在尝试使用该库时产生 js 错误.
This gives js errors when trying to use the library.
npm install chart.js
之后,
你可以简单地使用
import Chart from 'chart.js'
导入chart.js希望对您有所帮助.
to import chart.js Hope it helps.