Access the current page title and path and trigger an event when they change.
function useScriptEventPage(callback?: (title: string, path: string) => void): Ref<{ title: string, path: string }> {}
callback
(optional) - A function that will be called when the page title or path changes.A ref containing the current page title and path.
<script setup lang="ts">
useScriptEventPage((ctx) => {
console.log(ctx.title, ctx.path)
})
</script>