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
ie8 怎么兼容? #31
Comments
最新的omi-cli v0.2.2引擎默认加上了下面的webpack config和devDependencies配置。 webpack config里加上 //support ie8
plugins : [
"transform-es3-property-literals",
"transform-es3-member-expression-literals"
] devDependencies里加入了: "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0", 保险起见引用 es5-sham <!--[if lt IE 9]>
<script type="text/javascript" crossorigin="anonymous" src="//s.url.cn/qqun/xiaoqu/buluo/p/js/es5-sham-es5-sham.min.77c4325f.js"></script><![endif]--> |
我已经添加了上面的配置和es5-sham。。。 结果如下 消息: 对象不支持此属性或方法 我在bootstrap上下载的es5-sham,你给我的地址cdn由于公司的限制我链接不上。会和这个有关吗? |
重新build下项目 |
你把我发的cdn另存为 |
我肯定是重新运行的npm run dist呀 公司的网络禁止这个cdn了。。还没有别的cdn吗?或者给我发个邮件?wen-q@neusoft.com |
Npm Run dev试试,看下什么错 |
用Npm Run dev也一样,在IE8下面也看不出来什么错呀。 消息: 对象不支持此属性或方法 |
怎么会看不出来什么错啊 = =! 你全部都不要用压缩版的js就能看出来什么错了~~ 你这个看上去是你的es5-sham.js不兼容ie8. 而不是omi的问题 |
我的天。。IE8呀。老兄。我还真不知道用什么能查看到错误。 首先第一个错误点就是es5-sham.js报出来的,提示对象不支持此属性或方法,下一个错误就是 所以错误很明显,es5-sham根本没有起作用。 |
是的,所以说这个看上去是你的es5-sham.js不兼容ie8. 压根就没起作用 |
好使了。 之后放到了js目录。 并且在webpack上把两个源码压缩到了vendor.js里面。运行就成功了。不止需要sham还需要shim 我的配置如下: 这样在IE8下就正常的运行。 谢谢。 |
@louisscrew 谢谢兄弟,你的回答解决了我的大问题 |
Received with thanks.
|
我已经在index页面上引入了es5-shim.js
但是在运行的时候还是出现了错误。
错误如下:
网页错误详细信息
用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)
时间戳: Thu, 30 Mar 2017 07:39:28 UTC
消息: 对象不支持此操作
行: 1059
字符: 2
代码: 0
URI: file:///D:/screwspace/webfront/omi/test/dist/js/omi.27cdf71e.js
消息: 对象不支持此属性或方法
行: 1
字符: 1
代码: 0
URI: file:///D:/screwspace/webfront/omi/test/dist/js/omi.27cdf71e.js
消息: 缺少标识符、字符串或数字
行: 16
字符: 79
代码: 0
URI: file:///D:/screwspace/webfront/omi/test/dist/js/index.25f7b79d.js
应该还是兼容性的问题。
The text was updated successfully, but these errors were encountered: