xunleif2e / vue-lazy-component

🐌 Vue.js 2.x 组件级懒加载方案-Vue.js 2.x component level lazy loading solution
MIT License
1.01k stars 139 forks source link

Vue 2.5.16 运行出错 #9

Closed jacobcyl closed 6 years ago

jacobcyl commented 6 years ago

[Vue warn]: Error in mounted hook: "TypeError: window.IntersectionObserver is not a constructor"

found in

---> at /Users/benzhao/Sites/@xunlei/vue-lazy-component/src/VueLazyComponent.vue

at resources/assets/app/js/containers/IndexContainer.vue at resources/assets/app/js/pages/App.vue
binggg commented 6 years ago

某些浏览器不支持 IntersectionObserver

可以引入 IntersectionObserver polyfill

https://github.com/w3c/IntersectionObserver/tree/master/polyfill