setup() {
onBeforeMount(() => {
// 在挂载前执行
})
onMounted(() => {
// 在挂载后执行
})
onBeforeUpdate(() => {
// 在更新前前执行
})
onUpdated(() => {
// 在更新后执行
})
onBeforeUnmount(() => {
// 在组件销毁前执行
})
unMounted(() => {
// 在组件销毁后执行
})
return {}
}
setup 是created(),
watch和computed写在setup中