feat(computed): 添加计算属性功能实现
- 实现了 ComputedRefImpl 类来管理计算属性 - 添加了 computed 函数用于创建计算属性 - 在 ReactiveEffect 中添加 computed 属性引用 - 将 computed 导出到 reactivity 和 vue 主包 - 添加了 isFunction 工具函数判断函数类型 - 创建了计算属性的 HTML 示例文件进行演示
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user