const app = Vue.createApp({
setup(){
const {
ref,
onBeforeMount,
onMounted,
onBeforeUpdate,
onUpdate,
onBeforeUnmount,
onUnmount,
onRenderTracked, // 每次渲染后重新收集响应式依赖
onRenderTriggered, //每次触发页面重新渲染时自动执行
}
onBeforeMount(()=>{
console.log(onBeforeMount)
})
onMounted(()=>{
console.log(onMounted)
})
onBeforeUpdate(()=>{
console.log(onBeforeUpdate)
})
onUpdate(()=>{
console.log(onUpdate)
})
onBeforeUnmount(()=>{
console.log(onBeforeUnmount)
})
onUnmount(()=>{
console.log(onUnmount)
})
onRenderTracked(()=>{
console.log(onRenderTracked)
})
onRenderTriggered(()=>{
console.log(onRenderTriggered)
})
}
})
const vm = app.mount('#root');
暂无评论