mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
import{R as p}from"./chunks/theme.BptUtxMC.js";import{aN as s,aS as i,aT as u,aU as c,aV as l,aW as f,aX as d,aY as m,aZ as h,a_ as g,a$ as A,d as b,u as y,y as v,x as w,b0 as C,b1 as P,b2 as R,ap as S}from"./chunks/framework.C7RrxATG.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),T=b({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=y();return v(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),R(),n.setup&&n.setup(),()=>S(n.Layout)}});async function E(){globalThis.__VITEPRESS__=!0;const e=x(),a=_();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function _(){return A(T)}function x(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&E().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{E as createApp};
|