Skip to content

Commit

Permalink
Fix squeezable on production environments (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio authored Jun 15, 2024
1 parent 927f8ed commit 02b487a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/src/components/broadcast/Squeezable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div ref="big" class="squeezable" :style="{'--content-scale': allowedContentScale, '--content-transform-origin': (align || 'left')}" @click="updateWidth()">
<slot ref="small"></slot>
<slot></slot>
</div>
</template>

Expand Down Expand Up @@ -32,7 +32,7 @@ export default {
methods: {
updateWidth(isAfterTick) {
const big = this.$refs.big;
const small = this.$slots.default?.()?.[0]?.el || big?.__vnode?.children?.[0]?.children?.[0]?.el || big?.__vnode?.children?.[0]?.el;
const small = this.$el?.children?.[0];
// console.log({ big, small });
if (!big?.getBoundingClientRect || !small?.getBoundingClientRect) return;
Expand All @@ -49,7 +49,7 @@ export default {
if (!isAfterTick) this.$nextTick(() => this.updateWidth(true));
},
observerUpdate(...a) {
// console.log(a);
// console.log("observer update", a);
this.updateWidth();
}
},
Expand All @@ -58,7 +58,7 @@ export default {
this.elementObserver.observe(this.$refs.big);
const mutationObserver = new MutationObserver((...a) => {
console.log("mutation", a);
// console.log("mutation", a);
this.$nextTick(() => {
this.updateWidth(true);
});
Expand Down

0 comments on commit 02b487a

Please sign in to comment.