v-nuxt-ui 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -224,19 +224,21 @@ const flowContainer = ref(null);
|
|
|
224
224
|
let resizeObserver = null;
|
|
225
225
|
let prevWidth = 0;
|
|
226
226
|
onMounted(() => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
prevWidth
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
227
|
+
setTimeout(() => {
|
|
228
|
+
const el = flowContainer.value?.$el ?? flowContainer.value;
|
|
229
|
+
if (!el) return;
|
|
230
|
+
prevWidth = el.clientWidth;
|
|
231
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
232
|
+
const entry = entries[0];
|
|
233
|
+
if (!entry) return;
|
|
234
|
+
const newWidth = entry.contentRect.width;
|
|
235
|
+
if (newWidth !== prevWidth) {
|
|
236
|
+
prevWidth = newWidth;
|
|
237
|
+
nextTick(() => vueFlowFitView({ padding: props.fitViewPadding }));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
resizeObserver.observe(el);
|
|
241
|
+
}, 200);
|
|
240
242
|
});
|
|
241
243
|
onBeforeUnmount(() => {
|
|
242
244
|
resizeObserver?.disconnect();
|
package/package.json
CHANGED