我正在尝试通过 vue-cli 设置 vue 应用程序。一切都很顺利,直到我打字
npm install
Run Code Online (Sandbox Code Playgroud)
安装依赖项。https 出现错误,所以我将其更改为 http,但随后我收到以下日志:
npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning ECONNRESET: request to http://registry.npmjs.org/debug failed, reason: socket hang up
npm WARN registry Using stale package data from http://registry.npmjs.org/ due to a request error during revalidation.
Run Code Online (Sandbox Code Playgroud)
我也用过
npm config rm proxy
npm config rm https-proxy
Run Code Online (Sandbox Code Playgroud)
并且仍然有同样的问题。
我想添加到我的图表 setTimeout 函数来更新数据。下面列出了代码,但控制台说Uncaught TypeError: Cannot read property 'data' of undefined" how to access data array? and put my mew values? error is logging at the end of this code. in var ChartLine。或者也许如果你有任何其他想法如何动态更新数据请分享您的答案
var ctx = document.getElementById('chart').getContext("2d");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL"],
datasets: [{
label: "Data",
borderColor: gradientStroke,
pointBorderColor: gradientStroke,
pointBackgroundColor: gradientStroke,
pointHoverBackgroundColor: gradientStroke,
pointHoverBorderColor: gradientStroke,
pointBorderWidth: 5,
pointHoverRadius: 5,
pointHoverBorderWidth: 1,
pointRadius: 3,
fill: true,
backgroundColor: …Run Code Online (Sandbox Code Playgroud)