File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 comments : false ,
3+ presets : [
4+ [
5+ "@babel/env" ,
6+ {
7+ targets : {
8+ ie : "10" ,
9+ edge : "17" ,
10+ firefox : "60" ,
11+ chrome : "67" ,
12+ safari : "11.1"
13+ } ,
14+ useBuiltIns : "usage" ,
15+ corejs : "3.6.5"
16+ }
17+ ]
18+ ] ,
319 plugins : [ "transform-vue-jsx" ] ,
420 /* presets: [["env", { modules: false }]], */
521 env : {
Original file line number Diff line number Diff line change @@ -55,6 +55,22 @@ export default {
5555 this . observer . observe ( this . $el ) ;
5656 } ,
5757
58+ // is support IntersectionObserver
59+ isSupport ( ) {
60+ if (
61+ ! ( "IntersectionObserver" in window ) ||
62+ ! ( "IntersectionObserverEntry" in window ) ||
63+ ! (
64+ "intersectionRatio" in
65+ window . IntersectionObserverEntry . prototype
66+ )
67+ ) {
68+ console . warn (
69+ "Your browser does not support IntersectionObserver!"
70+ ) ;
71+ }
72+ } ,
73+
5874 // destroy observer
5975 destroyObserver ( ) {
6076 if ( this . observer ) {
@@ -64,6 +80,7 @@ export default {
6480 }
6581 } ,
6682 mounted ( ) {
83+ this . isSupport ( ) ;
6784 this . createObserver ( ) ;
6885 } ,
6986 beforeDestroy ( ) {
You can’t perform that action at this time.
0 commit comments