mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-17 13:36:57 +08:00
3 lines
1.1 KiB
JavaScript
3 lines
1.1 KiB
JavaScript
import{d as v,l as y,u as C,i as _,m as x,e as I,q as k,f,g as B,o as N,s as S,r as h,I as D}from"./index-Dboxe_cS.js";import{a as O,r as b}from"./use-app-0q7xvvVv.js";const H=v({name:"tmagic-overlay",__name:"index",props:{config:{},iteratorIndex:{},iteratorContainerId:{},containerIndex:{},pageFragmentContainerId:{},model:{},disabled:{type:Boolean}},setup(i,{expose:m}){var l;const c=i,n=y(!1),e=_("app"),u=C({componentType:"container",app:e}),t=()=>{n.value=!0,e==null||e.emit("overlay:open",r)},s=()=>{n.value=!1,e==null||e.emit("overlay:close",r)},a=(o,d)=>{d.find(g=>g.id===c.config.id)?t():s()};(l=e==null?void 0:e.page)==null||l.on("editor:select",a),e==null||e.on("page-change",()=>{var o;(o=e==null?void 0:e.page)==null||o.on("editor:select",a)}),x(()=>{var o;(o=e==null?void 0:e.page)==null||o.off("editor:select",a)});const r=O(c,e);return b(r,{openOverlay:t,closeOverlay:s}),m({openOverlay:t,closeOverlay:s}),(o,d)=>n.value?(N(),I(B(f(u)),{key:0,config:{items:i.config.items,[f(D)]:!1}},{default:S(()=>[h(o.$slots,"default")]),_:3},8,["config"])):k("",!0)}});export{H as default};
|
|
//# sourceMappingURL=index-CTTUTDRW.js.map
|