Warp/node_modules/vitepress/dist/client/theme-default/composables/hash.js
2024-01-05 19:14:38 +07:00

9 lines
258 B
JavaScript

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 };