L7Plot icon indicating copy to clipboard operation
L7Plot copied to clipboard

项目要运行在 IE 11 上,能提供一个编译到兼容 IE11 的版本么 🤔 [QUESTION]

Open shushu2013 opened this issue 2 years ago • 2 comments

项目引用 https://unpkg.com/@antv/l7plot@latest/dist/umd/l7plot.min.js

运行在 IE 11 上,报错了 “Symbol”未定义,IE11 不支持该 ES6 语法

需要做什么改动 L7Plot 才能支持啊,能提供一个编译到兼容 IE11 的版本么

shushu2013 avatar Apr 09 '22 10:04 shushu2013

提供 npm 安装,项目自行 babel 语法兼容打包吧。提供浏览器引入的 umd 方式后面可能发一个版本支持 IE11 @shushu2013

lvisei avatar Apr 09 '22 13:04 lvisei

加了一些 polyfill 可以在 IE 11 上显示了


    <script type="text/javascript" src="https://npm.elemecdn.com/@babel/[email protected]/dist/polyfill.js" crossorigin="anonymous"></script>
    <script type="text/javascript" src="https://npm.elemecdn.com/[email protected]/dist/fetch.umd.js" crossorigin="anonymous"></script>
    <script>
      // 针对 antv 在 IE 11 下 remove 方法的 polyfill
      if (!('remove' in Element.prototype)) {
        Element.prototype['remove'] = function () {
          if (this.parentNode) {
            this.parentNode.removeChild(this);
          }
        };
      }
    </script>
    <script type="text/javascript" src="https://npm.elemecdn.com/@antv/[email protected]/dist/g2plot.min.js" crossorigin="anonymous"></script>
    <script type="text/javascript" src="https://npm.elemecdn.com/@antv/[email protected]/dist/umd/l7plot.min.js" crossorigin="anonymous"></script>

shushu2013 avatar Apr 13 '22 06:04 shushu2013