<template>
    <h1>路由</h1>
    <button @click="toPage">路由测试</button>
</template>

<script lang="ts" setup>
const router = useRouter()
onBeforeMount(() => {
    console.log('onBeforeMount')
})
onMounted(() => {
    console.log('onMounted')
})

onBeforeUnmount(() => {
    console.log('onBeforeUnmount')
})
onUnmounted(() => {
    console.log('onUnmounted')
})
let a = computed(() => {
    return 'aaa'
})

console.log(a)

const toPage = () => {
    router.push({ name: 'piniaTest' })
}
</script>

<style scoped></style>
