我使用 vue-chartjs 创建了一个 Vue.js 项目。我尝试重新安装该库,但仍然出现此错误:
error in ./node_modules/chart.js/dist/chart.esm.js
Module parse failed: Unexpected token (6613:12)
You may need an appropriate loader to handle this file type.
| if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {
| decimated.push({
| ...data[intermediateIndex1],
| x: avgX,
| });
@ ./node_modules/vue-chartjs/es/BaseCharts.js 1:0-29
@ ./node_modules/vue-chartjs/es/index.js
Run Code Online (Sandbox Code Playgroud)
应用程序.vue:
<template>
<div id="app"></div>
</template>
<script>
import axios from "axios";
import moment from "moment";
import LineChart from "./components/LineChart";
export default {
name: "App",
components: {
LineChart
},
}
Run Code Online (Sandbox Code Playgroud)
折线图.vue
<script>
import …Run Code Online (Sandbox Code Playgroud)