作为测试,我已经把下面的解决方案拼凑在一起了,但是下面的内容我就想不起来了。
components文件夹中的
1. The chart still draws chartRender(this.chartData,this.options) but all the options are ignored....and just discovered I don't even need(chartRender) this? odd... why don't I need this?
所以我需要一点解释和帮助来解释为什么我可以画东西,但是它的表现并不像预期的那样,我也不理解图表是如何绘制的。
发布于 2019-05-28 03:57:17
在您的示例中有两个错误,每个错误都是一个“破坏”错误。
vm
的options
to <scatter>
组件的JavaScript表达式,而是一个值为'options'
的字符串。若要传递vm.options
属性,您需要在该属性前加上冒号(:
),冒号是‘re的缩写<scatter :chart-data="datacollection" :options="options"></scatter>
options
不正确地嵌套在它们自己的options
属性中。换句话说,this.options = {
options: {
legend: {
display: true,
position: "bottom"
},
title: {
display: true,
text: "This is the tiitle"
}
}
};
需要成为:
this.options = {
legend: {
display: true,
position: "bottom"
},
title: {
display: true,
text: "This is the tiitle"
}
};
看看它是如何工作的,here。
https://stackoverflow.com/questions/56327886
复制相似问题