feat(watch): 实现watch功能并完善响应式系统

- 新增apiWatch.ts实现watch功能,支持immediate和deep选项
- 扩展ReactiveEffect类添加stop方法用于停止监听
- 导出ReactiveEffect和isReactive函数供外部使用
- 添加ReactiveFlags枚举和IS_REACTIVE标识符
- 在reactive对象上添加__v_isReactive标识
- 导出EMPTY_OBJ常量用于默认参数
- 添加watch功能到Vue入口文件
- 创建watch.html示例验证监听功能正常工作
This commit is contained in:
dj
2026-02-25 22:15:42 +08:00
parent 4a71105e28
commit b9a9c52333
8 changed files with 103 additions and 4 deletions

View File

@@ -1,2 +1,2 @@
export { reactive, effect, ref, computed } from '@vue/reactivity'
export { queuePreFlushCb } from '@vue/runtime-core'
export { queuePreFlushCb, watch } from '@vue/runtime-core'