未捕获的 ReferenceError:未定义要求 - Chart.js未定义、ReferenceError、js、Chart

由网友(禁忌)分享简介:我使用 Chart.js(新版本)作为:I use Chart.js(new version) as :但是当我在 chrome 中演示时,我得到一个错误:But when i demo in chrome...

我使用 Chart.js(新版本)作为:

I use Chart.js(new version) as :

<script src="~/Plugin/Chart.js/src/chart.js"></script>

但是当我在 chrome 中演示时,我得到一个错误:

But when i demo in chrome, i get a error :

chart.js:4 Uncaught ReferenceError: require is not defined

图片

推荐答案

在您的代码中,改为拉取捆绑包.例如 ~/Plugin/Chart.js/dist/Chart.bundle.js

in your code, pull the bundle instead. E.g ~/Plugin/Chart.js/dist/Chart.bundle.js

阅读全文

相关推荐

最新文章