mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-18 03:19:19 +02:00
20 lines
406 B
TypeScript
20 lines
406 B
TypeScript
export default function () {
|
|
const config = useRuntimeConfig()
|
|
const route = useRoute()
|
|
|
|
function createCurrentUrl(options?: { hash?: string | null }) {
|
|
const url = new URL(route.fullPath || "/", config.public.appBaseURL)
|
|
|
|
if (options && "hash" in options) {
|
|
url.hash = options.hash || ""
|
|
}
|
|
|
|
return url
|
|
}
|
|
|
|
return {
|
|
currentUrl: computed(() => createCurrentUrl()),
|
|
createCurrentUrl,
|
|
}
|
|
}
|