feat(computed): 添加计算属性功能实现

- 实现了 ComputedRefImpl 类来管理计算属性
- 添加了 computed 函数用于创建计算属性
- 在 ReactiveEffect 中添加 computed 属性引用
- 将 computed 导出到 reactivity 和 vue 主包
- 添加了 isFunction 工具函数判断函数类型
- 创建了计算属性的 HTML 示例文件进行演示
This commit is contained in:
dj
2026-02-08 15:19:49 +08:00
parent c0853b353d
commit 4c60486511
6 changed files with 64 additions and 1 deletions

View File

@@ -9,3 +9,7 @@ export const isObject = (val: unknown) =>
*/
export const hasChanged = (value: any, oldValue: any): boolean =>
!Object.is(value, oldValue)
export const isFunction = (val: unknown): val is Function => {
return typeof val === 'function'
}