mirror of https://github.com/vuejs/vitepress
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.
24 lines
547 B
24 lines
547 B
5 years ago
|
import { createApp, ref, provide, h } from 'vue'
|
||
|
import { Layout } from '/@theme/index.js'
|
||
|
|
||
|
const app = createApp({
|
||
|
setup() {
|
||
|
const path = ref(window.location.pathname)
|
||
|
|
||
|
// window.addEventListener('click', e => {
|
||
|
// if (e.target.tagName === 'A') {
|
||
|
// e.preventDefault()
|
||
|
// if (e.target.href && e.target.href.indexOf(location.host)) {
|
||
|
// history.pushState(null, '', e.target.href)
|
||
|
// }
|
||
|
// }
|
||
|
// })
|
||
|
|
||
|
provide('vitepress:path', path)
|
||
|
|
||
|
return () => h(Layout)
|
||
|
}
|
||
|
})
|
||
|
|
||
|
app.mount('#app')
|