This commit is contained in:
2024-10-16 15:24:01 +08:00
parent c7f2091874
commit 6a15bbb2e0
10 changed files with 734 additions and 212 deletions

View File

@@ -172,11 +172,13 @@ function triggerRefValue(ref, newVal) {
}
}
}
var _a;
class ComputedRefImpl {
constructor(getter, _setter, isReadonly, isSSR) {
this._setter = _setter;
this.dep = void 0;
this.__v_isRef = true;
this[_a] = false;
this._dirty = true;
this.effect = new ReactiveEffect(getter, () => {
if (!this._dirty) {
@@ -201,6 +203,7 @@ class ComputedRefImpl {
this._setter(newValue);
}
}
_a = "__v_isReadonly";
function computed(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;