-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
Copy pathindex.ts
35 lines (33 loc) · 1.17 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import '@shikijs/vitepress-twoslash/style.css'
import './styles/index.css'
import { h, App, Plugin } from 'vue'
import { VPTheme } from '@vue/theme'
import twoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
import PreferenceSwitch from './components/PreferenceSwitch.vue'
import {
preferComposition,
preferSFC,
filterHeadersByPreference
} from './components/preferences'
import SponsorsAside from './components/SponsorsAside.vue'
import VueSchoolLink from './components/VueSchoolLink.vue'
// import Banner from './components/Banner.vue'
// import TextAd from './components/TextAd.vue'
export default Object.assign({}, VPTheme, {
Layout: () => {
// @ts-ignore
return h(VPTheme.Layout, null, {
// banner: () => h(Banner),
'sidebar-top': () => h(PreferenceSwitch),
'aside-mid': () => h(SponsorsAside)
})
},
enhanceApp({ app }: { app: App }) {
app.use(twoslashFloatingVue as Plugin<[]>)
app.provide('prefer-composition', preferComposition)
app.provide('prefer-sfc', preferSFC)
app.provide('filter-headers', filterHeadersByPreference)
app.component('VueSchoolLink', VueSchoolLink)
// app.component('TextAd', TextAd)
}
})