讨论加特殊图标

This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-03-21 15:49:12 +08:00
parent 0ed747a035
commit dd619643c9
202 changed files with 2973 additions and 2866 deletions

View File

@@ -1,3 +1,8 @@
/**
* @vue/reactivity v3.4.15
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
@@ -109,7 +114,7 @@ class ReactiveEffect {
/**
* @internal
*/
this._dirtyLevel = 3;
this._dirtyLevel = 2;
/**
* @internal
*/
@@ -121,7 +126,7 @@ class ReactiveEffect {
/**
* @internal
*/
this._queryings = 0;
this._shouldSchedule = false;
/**
* @internal
*/
@@ -130,10 +135,9 @@ class ReactiveEffect {
}
get dirty() {
if (this._dirtyLevel === 1) {
this._dirtyLevel = 0;
this._queryings++;
pauseTracking();
for (const dep of this.deps) {
for (let i = 0; i < this._depsLength; i++) {
const dep = this.deps[i];
if (dep.computed) {
triggerComputed(dep.computed);
if (this._dirtyLevel >= 2) {
@@ -141,13 +145,15 @@ class ReactiveEffect {
}
}
}
if (this._dirtyLevel < 2) {
this._dirtyLevel = 0;
}
resetTracking();
this._queryings--;
}
return this._dirtyLevel >= 2;
}
set dirty(v) {
this._dirtyLevel = v ? 3 : 0;
this._dirtyLevel = v ? 2 : 0;
}
run() {
this._dirtyLevel = 0;
@@ -269,22 +275,26 @@ const queueEffectSchedulers = [];
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
pauseScheduling();
for (const effect2 of dep.keys()) {
if (!effect2.allowRecurse && effect2._runnings) {
continue;
}
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
const lastDirtyLevel = effect2._dirtyLevel;
effect2._dirtyLevel = dirtyLevel;
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
if (lastDirtyLevel === 0) {
effect2._shouldSchedule = true;
effect2.trigger();
if (effect2.scheduler) {
queueEffectSchedulers.push(effect2.scheduler);
}
}
}
}
scheduleEffects(dep);
resetScheduling();
}
function scheduleEffects(dep) {
for (const effect2 of dep.keys()) {
if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
effect2._shouldSchedule = false;
queueEffectSchedulers.push(effect2.scheduler);
}
}
}
const createDep = (cleanup, computed) => {
const dep = /* @__PURE__ */ new Map();
@@ -361,7 +371,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
if (dep) {
triggerEffects(
dep,
3);
2);
}
}
resetScheduling();
@@ -915,7 +925,8 @@ class ComputedRefImpl {
this["__v_isReadonly"] = false;
this.effect = new ReactiveEffect(
() => getter(this._value),
() => triggerRefValue(this, 1)
() => triggerRefValue(this, 1),
() => this.dep && scheduleEffects(this.dep)
);
this.effect.computed = this;
this.effect.active = this._cacheable = !isSSR;
@@ -923,12 +934,15 @@ class ComputedRefImpl {
}
get value() {
const self = toRaw(this);
trackRefValue(self);
if (!self._cacheable || self.effect.dirty) {
if (shared.hasChanged(self._value, self._value = self.effect.run())) {
triggerRefValue(self, 2);
}
}
trackRefValue(self);
if (self.effect._dirtyLevel >= 1) {
triggerRefValue(self, 1);
}
return self._value;
}
set value(newValue) {
@@ -969,7 +983,7 @@ function trackRefValue(ref2) {
)));
}
}
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
function triggerRefValue(ref2, dirtyLevel = 2, newVal) {
ref2 = toRaw(ref2);
const dep = ref2.dep;
if (dep) {
@@ -1011,12 +1025,12 @@ class RefImpl {
if (shared.hasChanged(newVal, this._rawValue)) {
this._rawValue = newVal;
this._value = useDirectValue ? newVal : toReactive(newVal);
triggerRefValue(this, 3);
triggerRefValue(this, 2);
}
}
}
function triggerRef(ref2) {
triggerRefValue(ref2, 3);
triggerRefValue(ref2, 2);
}
function unref(ref2) {
return isRef(ref2) ? ref2.value : ref2;

View File

@@ -1,6 +1,6 @@
{
"name": "@vue/reactivity",
"version": "3.4.5",
"version": "3.4.15",
"description": "@vue/reactivity",
"main": "index.js",
"module": "dist/reactivity.esm-bundler.js",
@@ -19,6 +19,7 @@
"development": "./dist/reactivity.cjs.js",
"default": "./dist/reactivity.cjs.prod.js"
},
"module": "./dist/reactivity.esm-bundler.js",
"import": "./dist/reactivity.esm-bundler.js",
"require": "./index.js"
},
@@ -49,6 +50,6 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
"dependencies": {
"@vue/shared": "3.4.5"
"@vue/shared": "3.4.15"
}
}