mirror of https://github.com/vuejs/vitepress
fix: hashchange should only be triggered for same page navigations (#3768)
Co-authored-by: zonemeen <994718917@qq.com>pull/3770/head
parent
5f28e74abf
commit
2a9fc2a26b
@ -1,12 +0,0 @@
|
||||
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