提交 42952c97 编写于 作者: B big_sun_962464

Wed Jul 3 17:19:00 CST 2024 inscode

上级 e477716a
<template>
<div>
<h2>Com2-{{ msg }}</h2>
<h2 ref="refDom">Com2-{{ msg }}</h2>
<button @click="msg+='1'">changeMsg</button>
</div>
</template>
......@@ -9,22 +9,24 @@ import { ref,defineProps, computed, defineEmits, onActivated, onDeactivated, onB
const msg = ref('欢迎使用Vue')
debugger
const refDom = ref(null)
onBeforeMount(()=>{
debugger
console.log('Com2-onBeforeMount')
console.log('Com2-onBeforeMount',refDom.value)
})
onMounted(()=>{
debugger
console.log('Com2-onMounted')
console.log('Com2-onMounted',refDom.value)
})
onBeforeUpdate(()=>{
debugger
console.log('Com2-onBeforeUpdate')
console.log('Com2-onBeforeUpdate',refDom.value.innerHTML)
})
onUpdated(()=>{
debugger
console.log('Com2-onUpdated')
console.log('Com2-onUpdated',refDom.value.innerHTML)
})
onActivated(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册