refactor: keep alive

This commit is contained in:
张传龙
2022-09-09 09:53:49 +08:00
parent a5a3472486
commit 40483e09e6
8 changed files with 65 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
<template>
<CommonPage>
<div w-350>
<n-input v-model:value="inputVal" />
<n-input-number v-model:value="number" mt-30 />
</div>
</CommonPage>
</template>
<script setup>
defineOptions({ name: 'KeepAlive' })
const inputVal = ref('')
const number = ref(0)
onMounted(() => {
$message.success('onMounted')
})
onUnmounted(() => {
$message.error('onUnmounted')
})
onActivated(() => {
$message.info('onActivated')
})
onDeactivated(() => {
$message.warning('onDeactivated')
})
</script>