Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Apr 19, 2023
1 parent de67cbc commit 1c1509d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,11 +965,13 @@ Code related to measuring the size of the carousel after mounting
// Add resize listening
mounted: function () {
this.onResize();
return window.addEventListener('resize', this.onResize);
// Resize observer listens for the element itself to change dimensions
this.resizeObserver = new ResizeObserver(this.onResize);
return this.resizeObserver.observe(this.$el);
},
// Cleanup listeners
beforeDestroy: function () {
return window.removeEventListener('resize', this.onResize);
var ref;
return (ref = this.resizeObserver) != null ? ref.disconnect() : void 0;
},
computed: {
// The width of a page of slides, which may be less than the carouselWidth
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-ssr-carousel",
"version": "2.1.0",
"version": "2.2.0",
"description": "A performance focused Vue carousel designed for SSR/SSG environments.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 1c1509d

Please sign in to comment.