2024-03-25 01:06:44 +08:00

13 lines
252 B
TypeScript

import { ref } from 'vue'
import { inBrowser } from '../utils/index.js'
const hashRef = ref(inBrowser ? location.hash : '')
if (inBrowser) {
window.addEventListener('hashchange', () => {
hashRef.value = location.hash
})
}
export { hashRef }