Warp/node_modules/vitepress/dist/client/theme-default/composables/hash.js

10 lines
258 B
JavaScript
Raw Normal View History

2024-01-05 12:14:38 +00:00
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 };