鍍金池/ 問答/HTML/ IE上引入的所有組件都報無法獲取未定義或 null 引用的屬性“transfer

IE上引入的所有組件都報無法獲取未定義或 null 引用的屬性“transfer”"是什么原因

引入的所有組件在IE上都報警告錯誤

clipboard.png

求大神解答,感激不盡

回答
編輯回答
菊外人

ie9會報這個錯誤吧,11好像沒有,ie9原生不支持dataset,可以改下iview源碼解決下,iview里有個directives叫transfer-dom.js,涉及到這幾句代碼:
19行 inserted (el, { value }, vnode) {
改為 if (el.dataset && (el.dataset.transfer !== 'true')) return false;

41行 componentUpdated (el, { value }) {
改為 if (el.dataset && (el.dataset.transfer !== 'true')) return false;

65行 unbind (el) {
改為 if (el.dataset && (el.dataset.transfer !== 'true')) return false;

然后自己把iview重新npm run dist一下,把打包出來的復(fù)制到nodemodules下的相應(yīng)位置就好了

2018年2月8日 00:26