bill пре 2 година
родитељ
комит
a023f70ff8
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      src/model/app.vue

+ 7 - 2
src/model/app.vue

@@ -47,6 +47,7 @@ export const Model = defineComponent({
       if (urls[type] !== url.value) {
         setTimeout(() => {
           const hook = (iframeRef.value?.contentWindow as any)?.beforeDestroy
+          console.log(hook)
           if (hook) {
             hook()
             setTimeout(() => url.value = urls[type], 300)
@@ -58,12 +59,16 @@ export const Model = defineComponent({
     })
 
 
+
     const fuseRef = ref<HTMLDivElement>()
     const iframeRef = ref<HTMLIFrameElement>()
 
     watch(
-      () => modelProps.type, 
-      async (type, oldType, onCleanup) => {
+      () => [modelProps.type, url.value],
+      async ([type, url], oldType, onCleanup) => {
+        if (type !== fuseModel && !url) {
+          return;
+        }
         const callback = modelProps.callback
 
         await nextTick()