mirror of https://github.com/vuejs/vitepress
parent
1517cdfc18
commit
c1e502b590
@ -0,0 +1,12 @@
|
|||||||
|
import { inBrowser } from '../../shared'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const hashRef = ref(inBrowser ? location.hash : '')
|
||||||
|
|
||||||
|
if (inBrowser) {
|
||||||
|
window.addEventListener('hashchange', () => {
|
||||||
|
hashRef.value = location.hash
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export { hashRef }
|
Loading…
Reference in new issue