You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{v as L,p as R,_ as k}from"./entry/index-C2Ijy48E-1723706691540.js";import{a as z}from"./useContentViewHeight-BBd42TOY.js";import{E as C}from"./antd-BY-1PcYE.js";import{d as W,f as o,c as $,u as s,o as B,b as I,_ as M,$ as F,k as N,a9 as V,ah as p,a2 as g,a0 as b}from"./vue-aEZWZQSa.js";import{u as D}from"./useWindowSizeFn-CjdUjzGl.js";const T=["src"],U=W({__name:"index",props:{frameSrc:L.string.def("")},emits:["message"],setup(h,{expose:_,emit:v}){const w=v,a=o(!0),x=o(50),r=o(window.innerHeight),n=o(),{headerHeightRef:y}=z(),{prefixCls:c}=R("iframe-page");D(l,{wait:150,immediate:!0});const m=$(()=>({height:`${s(r)}px`}));function l(){const e=s(n);if(!e)return;const t=y.value;x.value=t,r.value=window.innerHeight-t;const i=document.documentElement.clientHeight-t;e.style.height=`${i}px`}function H(){a.value=!1,l()}const f=e=>{w("message",e.data)},S=(e,t,i)=>{var d;const u=s(n);u&&((d=u.contentWindow)==null||d.postMessage(e,t,i))},E=()=>{var t;a.value=!0;const e=n.value;e&&((t=e.contentWindow)==null||t.location.reload(),a.value=!1)};return B(()=>{window.addEventListener("message",f)}),I(()=>{window.removeEventListener("message",f)}),_({postMessage:S,reload:E}),(e,t)=>(M(),F("div",{class:g(s(c)),style:p(m.value)},[N(s(C),{spinning:a.value,size:"large",style:p(m.value)},{default:V(()=>[b("iframe",{src:h.frameSrc,class:g(`${s(c)}__main`),ref_key:"frameRef",ref:n,onLoad:H},null,42,T)]),_:1},8,["spinning","style"])],6))}}),K=k(U,[["__scopeId","data-v-745ce992"]]);export{K as I};
|