umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.41k stars 2.66k forks source link

umi-plugin-polyfill 兼容问题 #2177

Closed yehoan closed 5 years ago

yehoan commented 5 years ago

.umirc.js export default { plugins: ['umi-plugin-polyfill', 'umi-plugin-dva'], hashHistory: true, pages: { '/withdrawal': { Route: './src/PrivateRoute.js' }, '/userinfo': { Route: './src/PrivateRoute.js' }, '/transfer': { Route: './src/PrivateRoute.js' }, '/security': { Route: './src/PrivateRoute.js' }, '/recharge': { Route: './src/PrivateRoute.js' }, '/home': { Route: './src/PrivateRoute.js' }, '/account': { Route: './src/PrivateRoute.js' }, '/bankcard': { Route: './src/PrivateRoute.js' }, '/bankcard/add': { Route: './src/PrivateRoute.js' }, '/lottery/11x5/:name?': { Route: './src/PrivateRoute.js' }, '/lottery/pk10/:name?': { Route: './src/PrivateRoute.js' }, '/lottery/ssc/:name?': { Route: './src/PrivateRoute.js' }, '/password/withdraw': { Route: './src/PrivateRoute.js' }, '/password/login': { Route: './src/PrivateRoute.js' }, '/report/hg-bet-record': { Route: './src/PrivateRoute.js' }, '/report/bbin-bet-record': { Route: './src/PrivateRoute.js' } } }

之前用的fill这个方法 然后我发现在ie下不支持 之前我用其他的自己引入 babel-polyfill 在webpack config.js 里面调用即可 但是在umi 里面我也配置了umi-ployfill但是没用

sorrycc commented 5 years ago

umi@2 不要用这个,用 target 配置,官网上搜一下。

yehoan commented 5 years ago

我这个还是1.0的

yehoan commented 5 years ago

image 这样貌似不是这样配置的吧

yehoan commented 5 years ago

image

sorrycc commented 5 years ago
  1. 找时间升到 umi@2
  2. 用 umi@1,可以试下不要 umi-plugin-polyfill,然后自己引相应版本的 @babel/polyfill
yehoan commented 5 years ago

升级到2 是不是直接按照https://umijs.org/zh/guide/migration.html#npm-%E4%BE%9D%E8%B5%96 这个说的就可以了 因为项目人手就我一个 所以 一直比较忙

sorrycc commented 5 years ago

是。

yehoan commented 5 years ago

升级了 有BUG 申请咨询一下

yehoan commented 5 years ago

image

yehoan commented 5 years ago

还有就是之,umi.js 里面的page 对象改如何处理

yehoan commented 5 years ago

那些路由

yehoan commented 5 years ago

image

yehoan commented 5 years ago

exclude 只能用函数或者是正则拿我这种改如何处理

yehoan commented 5 years ago

我这个是权限路由 2.0 改如何处理

yehoan commented 5 years ago

image 升级以后 mapStateToProps 从其他组件的state 的值都是undefined?

sorrycc commented 5 years ago

没理解问题,重新整理下,提供可复现步骤。