Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11兼容,急急急 #16

Closed
2 tasks done
jocklei opened this issue Feb 6, 2018 · 8 comments · Fixed by #18
Closed
2 tasks done

IE11兼容,急急急 #16

jocklei opened this issue Feb 6, 2018 · 8 comments · Fixed by #18
Labels
help wanted Extra attention is needed

Comments

@jocklei
Copy link

jocklei commented Feb 6, 2018

Issue Type:

  • Bug
  • Help

Version & Environment:
0.5.6

Description:
用element-angular组件在别的浏览器下面没有问题,但是在IE11浏览器下面报错,怎么回事儿,怎么处理啊,急急急!!!
报错信息如下:
1、SCRIPT1002: 语法错误
vendor.d728a6e48f330e2ec5f4.bundle.js (44114,1)
定位到代码位置:
class ElAlert {
constructor() {
this.type = 'info';
this.center = false;
this.closable = true;
this.closeText = '';
this.showIcon = false;
this.close = new WEBPACK_IMPORTED_MODULE_0__angular_core"EventEmitter";
this.visible = true;
}/
2、SCRIPT5007: 无法获取未定义或 null 引用的属性“call”
inline.be6425cc5ee786827d95.bundle.js (55,12)
定位到代码位置为:
modules[moduleId].call(module.exports, module, module.exports, webpack_require);

@unix
Copy link
Contributor

unix commented Feb 6, 2018

Element Angular 输出的是 ES6 代码,如果你引用了组件应该自己压缩或提供 polyfills,组件本身不包含任何 shim。
简单的说,Element 本身没有扩展任何语法,没有创造语法,使用的都是标准的 ES6 语法,在 Angular 的允许范围之内。这是你的代码 ES6 语法没有正确的转化为 ES5 或是缺少 polyfill 所致,在 IE11 下具体是缺少哪些特性需要你自己判断填补。
最后重要的事情再说一次,UI 库本身不会扩展语法与创造语法。

@unix unix added the help wanted Extra attention is needed label Feb 6, 2018
@jocklei
Copy link
Author

jocklei commented Feb 6, 2018

没完全搞明白,直接说怎么处理,在IE11下面不报错就行,多谢!

@unix
Copy link
Contributor

unix commented Feb 6, 2018

直接说就是不是 UI 库的问题,是你没做好兼容。

@unix unix closed this as completed Feb 6, 2018
@jocklei
Copy link
Author

jocklei commented Feb 7, 2018 via email

@jocklei
Copy link
Author

jocklei commented Feb 7, 2018 via email

@XGHeaven
Copy link

XGHeaven commented Feb 7, 2018

请给出能复现的代码。

@jocklei
Copy link
Author

jocklei commented Feb 8, 2018 via email

@unix
Copy link
Contributor

unix commented Feb 8, 2018

原因在于 angular/cli 不能将第三方的 ES6 代码转译成 ES5,在没有自己编写编译脚本或使用 eject 的项目中,打包出的代码包含 ES6 引起的 IE 的错误。
目前跳转 element-angular 输出为 ES5,你可以升级再重试。
参考 #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants