ant-design-pro IE9下報錯集合

weixin_34116110發表於2018-10-07

1.下載下來eslint報錯:Expected linebreaks to be ‘LF’ but found ‘CRLF’
解決方法:新增或修改linebreak-style為 ["error", "windows"],即
rules: { 'linebreak-style': ["error", "windows"], },
2.IE9下佈局錯亂如下圖:

4386699-a916a89c1066a99a.png
image.png

解決方法:
<!-[if IE 9]> <style> .ant-layout-has-sider > .ant-layout-sider { float: left; position: relative; height: 100% !important; } </style> <![endif]-->

  1. 無法獲取未定義或 null 引用的屬性“authority”或者The Intl APIs must be available in the runtime, and do not appear to be built-in. An Intl polyfill should be loaded.或者requestAnimationFrame not defined
    第一步:
    $ npm install --save intl @babel-polyfill
    第二步,在src下新建一個global.js檔案,新增如下程式碼
    import '@babel/polyfill'; global.requestAnimationFrame = function(callback) { setTimeout(callback, 0); }; global.cancelAnimationFrame= function(callback) { setTimeout(callback, 0); }; global.Intl = require('intl'); window.Intl = require('intl');

相關文章