hashchange should not be triggered when navigating between different pages
This PR also adds hash property in useData output for those who want to watch for hash change while navigating between pages - say from /foo#bar to /. Those who don't want this should stick with window.addEventListener('hashchange', ...)
It also emits correct event instance with oldURL and newURL for hashchange now.
reverts parts of https://github.com/vuejs/vitepress/compare/f6bd99eb1311238e1114301a767634b139327916...49ea062b3984440b98aeb1158b390d92d7fe4670
The original implementation by zonemeen was correct - https://github.com/vuejs/vitepress/pull/3637/commits/59e177362306bf9947c6854315374ffd2ea465ad
hashchange
should not be triggered when navigating between different pagesThis PR also adds
hash
property inuseData
output for those who want to watch for hash change while navigating between pages - say from/foo#bar
to/
. Those who don't want this should stick withwindow.addEventListener('hashchange', ...)
It also emits correct event instance with
oldURL
andnewURL
forhashchange
now.