|
@@ -83,13 +83,17 @@ export default {
|
|
|
},
|
|
|
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);
|
|
|
+ let _class = document.querySelector('.canvas');
|
|
|
+ if (_class === null) return;
|
|
|
+ if (_class.classList.contains('canvas')) {
|
|
|
+ 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() {
|