Laravel consoletvs/charts 和 IE11

Laravel consoletvs/charts and IE11

我正在使用 consoletvs/charts 在我的 Laravel 应用程序中显示图表。

这在所有现代浏览器中都可以正常工作,但我在 Internet Explorer 11 及以下版本中得到 syntax error(并且没有显示图表)。 向下追踪它似乎是这一行(来自 consoletvs/charts,例如 init.blade.php 第 8 行)导致(初始)错误:

data => data.json()

所以罪魁祸首是箭头运算符,在 IE11 中不受支持。使用 polyfill 似乎是不可能的(参见 Is there a polyfill for es6 arrow function?)。

现在我的问题是:

  1. 我是否错过了 consoletvs/charts 中的某个功能?
  2. 是否有 "Laravel" 方法来解决这个问题(例如使用 babel/babel)?
  3. 有人在 IE11 上 consoletvs/charts 运行 吗?

根据您在 ConsoleTVs/Charts 的 GitHub 问题页面上获得的建议,您似乎已经找到了问题的答案。

I will be changing this library to use my other tool: https://github.com/Chartisan

This have a babel compilation step on the front-end or a pre-compiled one. Also, the only thing needed will be the fetch() function. This can be polyfilled.

Just stay tunned. I am writting the docs of Chartisan, and this lib will soon be ported to that.

参考:

Syntax Error on IE11 #554

按照建议,您应该等待 Chartisan

的文档