|
@@ -96,8 +96,22 @@ export default {
|
|
|
this.isViewTopBottomBtn();
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.resizeObserver = new ResizeObserver((entries) => {
|
|
|
+ for (let entry of entries) {
|
|
|
+ this.elementWidth = entry.contentRect.width;
|
|
|
+ this.elementHeight = entry.contentRect.height;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.resizeObserver.observe(this.$el);
|
|
|
+ });
|
|
|
+ },
|
|
|
beforeDestroy() {
|
|
|
window.removeEventListener('resize', this.handleResize);
|
|
|
+ if (this.resizeObserver) {
|
|
|
+ this.resizeObserver.disconnect();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
handleAudioClick(index) {
|