01 2025 档案

生命周期
摘要:main.vue <template> <div @click="isShow">显隐</div> <componentA v-if="!flag"></componentA> </template> <script setup lang='ts'> import { ref } from 'vue 阅读全文

posted @ 2025-01-31 17:39 ChoZ 阅读(5) 评论(0) 推荐(0) 编辑

watchEffect
摘要:<template> <div> <input type="text" v-model="name" /> <div id="beWatch"></div> <!-- <button @click="stopEffect">停止</button> --> </div> </template> <sc 阅读全文

posted @ 2025-01-31 16:19 ChoZ 阅读(5) 评论(0) 推荐(0) 编辑

watch
摘要:<template> <div> <input type="text" v-model="name" /> <input type="text" v-model="obj.age" /> <input type="text" v-model="refName.age" /> </div> </tem 阅读全文

posted @ 2025-01-31 15:45 ChoZ 阅读(10) 评论(0) 推荐(0) 编辑

vue3 响应式原理源码
摘要:1.使用Proxy来编码reactive源码,在get函数中追踪依赖,在set函数中触发依赖 2.编写track和trigger,和自定义effect函数 构建依赖图根据这种数据结构 3.使用自定义的reactive函数和自定义effect函数 阅读全文

posted @ 2025-01-31 15:44 ChoZ 阅读(1) 评论(0) 推荐(0) 编辑

computed
摘要:<template> <div> <h1>{{ firstName }}</h1> <h1>{{ lastName }}</h1> <br> <h2>{{ fullName }}</h2> <!-- <button type="submit" @click="update">修改</button> 阅读全文

posted @ 2025-01-30 15:50 ChoZ 阅读(3) 评论(0) 推荐(0) 编辑

toRef,toRefs,toRaw
摘要:<template> <div @click="change"> {{ originObj }} -- {{ reactObj }} {{ toOrigin }} -- {{ toReactRef }} -- {{ toReactRefs }} </div> </template> <script 阅读全文

posted @ 2025-01-30 15:50 ChoZ 阅读(3) 评论(0) 推荐(0) 编辑

reactive
摘要:<template> <h1>{{ obj.count }}</h1> <h1>{{ shallowObj }}</h1> <button @click="change">change</button> </template> <script setup lang="ts"> import { re 阅读全文

posted @ 2025-01-30 15:49 ChoZ 阅读(12) 评论(0) 推荐(0) 编辑

ref
摘要:<template> <h1 @click="addCount">{{ count }}</h1> <h1 @click="addCountObj">{{ countObj.count }}</h1> <div ref="divRef"></div> </template> <script setu 阅读全文

posted @ 2025-01-30 15:46 ChoZ 阅读(11) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示