You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/lib/app/index.js

27 lines
567 B

import { createApp, h } from 'vue'
import { Content } from './components/Content'
import { useRouter } from './composables/router'
import { useSiteData } from './composables/data'
import Theme from '/@theme/index'
const App = {
setup() {
if (typeof window !== 'undefined') {
useRouter()
} else {
// TODO inject static route for SSR
}
return () => h(Theme.Layout)
}
}
const app = createApp(App)
Object.defineProperty(app.config.globalProperties, '$site', {
get: useSiteData
})
app.component('Content', Content)
app.mount('#app')