【发布时间】:2017-09-07 14:06:44
【问题描述】:
我正在使用来自 vue 和 vue-chartjs 的预打包脚本文件,并将它们添加到页面中。
最初没有视图工作,在 ie10 上打开开发工具后,我看到像 =>、let 和 myFunc(): .... 这样的 es6 内容正在破坏页面。
所以我删除了这个,现在图表的轮廓和布局显示,轴的比例甚至在获取新数据时发生变化。但是,图表中实际上并没有显示任何内容。
我怀疑是这个新的html标签,ie无法识别:
<line-chart
:data="myData"
:options="{responsive: false, maintainAspectRatio: false}"
:width="400"
:height="200"
>
</line-chart>
更新:
getQueueData 函数从 API 获取数据
getQueueData: function() {
var selectedBranch = this.selectedBranch;
var selectedDay = this.selectedDay;
var vm = this;
this.$http.get('/api/v1/branches/' + selectedBranch + '/queues/' + selectedDay + '/').then(function(response) {
vm.queueData = response.body;
vm.fillData();
}, function(response) {
alert('Whoops! Something went wrong.')
vm.queueData = [];
});
},
【问题讨论】:
-
你能提供一个 jsfiddle/codepen 吗?因为我在 ie10 codepen.io/anon/pen/XaLJXq?editors=1010 中运行了以下示例
-
这是笔,不幸的是它按预期工作:codepen.io/surfer190/pen/XaLEqR 请参阅
getQueueData函数我正在使用 Vue 资源来实际获取数据,但我无法在 codepen 中提出该请求。我已经在问题中添加了实际代码。
标签: vuejs2 vue-component vue-chartjs