This commit is contained in:
2024-10-22 09:09:41 +08:00
parent ef869c5ab1
commit 3a9b2d55c6
99 changed files with 4506 additions and 3465 deletions

View File

@@ -149,7 +149,9 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
}
}
}
new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
new Set(
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
);
function toRaw(observed) {
const raw = observed && observed["__v_raw"];
return raw ? toRaw(raw) : observed;
@@ -170,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) {
@@ -199,6 +203,7 @@ class ComputedRefImpl {
this._setter(newValue);
}
}
_a = "__v_isReadonly";
function computed(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;