File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -965,11 +965,13 @@ Code related to measuring the size of the carousel after mounting
965965 // Add resize listening
966966 mounted : function ( ) {
967967 this . onResize ( ) ;
968- return window . addEventListener ( 'resize' , this . onResize ) ;
968+ // Resize observer listens for the element itself to change dimensions
969+ this . resizeObserver = new ResizeObserver ( this . onResize ) ;
970+ return this . resizeObserver . observe ( this . $el ) ;
969971 } ,
970- // Cleanup listeners
971972 beforeDestroy : function ( ) {
972- return window . removeEventListener ( 'resize' , this . onResize ) ;
973+ var ref ;
974+ return ( ref = this . resizeObserver ) != null ? ref . disconnect ( ) : void 0 ;
973975 } ,
974976 computed : {
975977 // The width of a page of slides, which may be less than the carouselWidth
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-ssr-carousel" ,
3- "version" : " 2.1 .0" ,
3+ "version" : " 2.2 .0" ,
44 "description" : " A performance focused Vue carousel designed for SSR/SSG environments." ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments