@vue/runtime-core 3.5.0-rc.1 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +15 -10
- package/dist/runtime-core.cjs.prod.js +11 -9
- package/dist/runtime-core.d.ts +17 -19
- package/dist/runtime-core.esm-bundler.js +16 -11
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1145,7 +1145,9 @@ const BaseTransitionImpl = {
|
|
|
1145
1145
|
// #11061, ensure enterHooks is fresh after clone
|
|
1146
1146
|
(hooks) => enterHooks = hooks
|
|
1147
1147
|
);
|
|
1148
|
-
|
|
1148
|
+
if (innerChild.type !== Comment) {
|
|
1149
|
+
setTransitionHooks(innerChild, enterHooks);
|
|
1150
|
+
}
|
|
1149
1151
|
const oldChild = instance.subTree;
|
|
1150
1152
|
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
1151
1153
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
@@ -1468,10 +1470,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1468
1470
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
1469
1471
|
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1470
1472
|
const setupState = owner.setupState;
|
|
1473
|
+
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => shared.hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || shared.EMPTY_OBJ).get;
|
|
1471
1474
|
if (oldRef != null && oldRef !== ref) {
|
|
1472
1475
|
if (shared.isString(oldRef)) {
|
|
1473
1476
|
refs[oldRef] = null;
|
|
1474
|
-
if (
|
|
1477
|
+
if (canSetSetupRef(oldRef)) {
|
|
1475
1478
|
setupState[oldRef] = null;
|
|
1476
1479
|
}
|
|
1477
1480
|
} else if (reactivity.isRef(oldRef)) {
|
|
@@ -1486,14 +1489,14 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1486
1489
|
if (_isString || _isRef) {
|
|
1487
1490
|
const doSet = () => {
|
|
1488
1491
|
if (rawRef.f) {
|
|
1489
|
-
const existing = _isString ?
|
|
1492
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1490
1493
|
if (isUnmount) {
|
|
1491
1494
|
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
1492
1495
|
} else {
|
|
1493
1496
|
if (!shared.isArray(existing)) {
|
|
1494
1497
|
if (_isString) {
|
|
1495
1498
|
refs[ref] = [refValue];
|
|
1496
|
-
if (
|
|
1499
|
+
if (canSetSetupRef(ref)) {
|
|
1497
1500
|
setupState[ref] = refs[ref];
|
|
1498
1501
|
}
|
|
1499
1502
|
} else {
|
|
@@ -1506,7 +1509,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1506
1509
|
}
|
|
1507
1510
|
} else if (_isString) {
|
|
1508
1511
|
refs[ref] = value;
|
|
1509
|
-
if (
|
|
1512
|
+
if (canSetSetupRef(ref)) {
|
|
1510
1513
|
setupState[ref] = value;
|
|
1511
1514
|
}
|
|
1512
1515
|
} else if (_isRef) {
|
|
@@ -1856,8 +1859,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
1856
1859
|
const isText = vnode.type === Text;
|
|
1857
1860
|
if (node) {
|
|
1858
1861
|
if (isText && !optimized) {
|
|
1859
|
-
|
|
1860
|
-
if (next && (next = normalizeVNode(next)).type === Text) {
|
|
1862
|
+
if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
|
|
1861
1863
|
insert(
|
|
1862
1864
|
createText(
|
|
1863
1865
|
node.data.slice(vnode.children.length)
|
|
@@ -2113,7 +2115,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
2113
2115
|
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2114
2116
|
const cssVars = instance.getCssVars();
|
|
2115
2117
|
for (const key in cssVars) {
|
|
2116
|
-
expectedMap.set(
|
|
2118
|
+
expectedMap.set(
|
|
2119
|
+
`--${shared.getEscapedCssVarName(key, false)}`,
|
|
2120
|
+
String(cssVars[key])
|
|
2121
|
+
);
|
|
2117
2122
|
}
|
|
2118
2123
|
}
|
|
2119
2124
|
if (vnode === root && instance.parent) {
|
|
@@ -8202,7 +8207,7 @@ function isMemoSame(cached, memo) {
|
|
|
8202
8207
|
return true;
|
|
8203
8208
|
}
|
|
8204
8209
|
|
|
8205
|
-
const version = "3.5.
|
|
8210
|
+
const version = "3.5.1";
|
|
8206
8211
|
const warn = warn$1 ;
|
|
8207
8212
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8208
8213
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -723,7 +723,9 @@ const BaseTransitionImpl = {
|
|
|
723
723
|
// #11061, ensure enterHooks is fresh after clone
|
|
724
724
|
(hooks) => enterHooks = hooks
|
|
725
725
|
);
|
|
726
|
-
|
|
726
|
+
if (innerChild.type !== Comment) {
|
|
727
|
+
setTransitionHooks(innerChild, enterHooks);
|
|
728
|
+
}
|
|
727
729
|
const oldChild = instance.subTree;
|
|
728
730
|
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
729
731
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
@@ -1026,10 +1028,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1026
1028
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
1027
1029
|
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1028
1030
|
const setupState = owner.setupState;
|
|
1031
|
+
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => shared.hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || shared.EMPTY_OBJ).get;
|
|
1029
1032
|
if (oldRef != null && oldRef !== ref) {
|
|
1030
1033
|
if (shared.isString(oldRef)) {
|
|
1031
1034
|
refs[oldRef] = null;
|
|
1032
|
-
if (
|
|
1035
|
+
if (canSetSetupRef(oldRef)) {
|
|
1033
1036
|
setupState[oldRef] = null;
|
|
1034
1037
|
}
|
|
1035
1038
|
} else if (reactivity.isRef(oldRef)) {
|
|
@@ -1044,14 +1047,14 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1044
1047
|
if (_isString || _isRef) {
|
|
1045
1048
|
const doSet = () => {
|
|
1046
1049
|
if (rawRef.f) {
|
|
1047
|
-
const existing = _isString ?
|
|
1050
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1048
1051
|
if (isUnmount) {
|
|
1049
1052
|
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
1050
1053
|
} else {
|
|
1051
1054
|
if (!shared.isArray(existing)) {
|
|
1052
1055
|
if (_isString) {
|
|
1053
1056
|
refs[ref] = [refValue];
|
|
1054
|
-
if (
|
|
1057
|
+
if (canSetSetupRef(ref)) {
|
|
1055
1058
|
setupState[ref] = refs[ref];
|
|
1056
1059
|
}
|
|
1057
1060
|
} else {
|
|
@@ -1064,7 +1067,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1064
1067
|
}
|
|
1065
1068
|
} else if (_isString) {
|
|
1066
1069
|
refs[ref] = value;
|
|
1067
|
-
if (
|
|
1070
|
+
if (canSetSetupRef(ref)) {
|
|
1068
1071
|
setupState[ref] = value;
|
|
1069
1072
|
}
|
|
1070
1073
|
} else if (_isRef) {
|
|
@@ -1380,8 +1383,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1380
1383
|
const isText = vnode.type === Text;
|
|
1381
1384
|
if (node) {
|
|
1382
1385
|
if (isText && !optimized) {
|
|
1383
|
-
|
|
1384
|
-
if (next && (next = normalizeVNode(next)).type === Text) {
|
|
1386
|
+
if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
|
|
1385
1387
|
insert(
|
|
1386
1388
|
createText(
|
|
1387
1389
|
node.data.slice(vnode.children.length)
|
|
@@ -6376,7 +6378,7 @@ function isMemoSame(cached, memo) {
|
|
|
6376
6378
|
return true;
|
|
6377
6379
|
}
|
|
6378
6380
|
|
|
6379
|
-
const version = "3.5.
|
|
6381
|
+
const version = "3.5.1";
|
|
6380
6382
|
const warn$1 = shared.NOOP;
|
|
6381
6383
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6382
6384
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -269,13 +269,13 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
|
|
|
269
269
|
slots?: never;
|
|
270
270
|
}): void;
|
|
271
271
|
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
272
|
-
export type ModelRef<T, M extends PropertyKey = string> = Ref<
|
|
273
|
-
ModelRef<T, M>,
|
|
272
|
+
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
|
|
273
|
+
ModelRef<T, M, G, S>,
|
|
274
274
|
Record<M, true | undefined>
|
|
275
275
|
];
|
|
276
|
-
type DefineModelOptions<T = any> = {
|
|
277
|
-
get?: (v: T) =>
|
|
278
|
-
set?: (v:
|
|
276
|
+
type DefineModelOptions<T = any, G = T, S = T> = {
|
|
277
|
+
get?: (v: T) => G;
|
|
278
|
+
set?: (v: S) => any;
|
|
279
279
|
};
|
|
280
280
|
/**
|
|
281
281
|
* Vue `<script setup>` compiler macro for declaring a
|
|
@@ -310,20 +310,18 @@ type DefineModelOptions<T = any> = {
|
|
|
310
310
|
* const count = defineModel<number>('count', { default: 0 })
|
|
311
311
|
* ```
|
|
312
312
|
*/
|
|
313
|
-
export declare function defineModel<T, M extends PropertyKey = string>(options: {
|
|
314
|
-
required: true;
|
|
315
|
-
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
316
|
-
export declare function defineModel<T, M extends PropertyKey = string>(options: {
|
|
313
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
317
314
|
default: any;
|
|
318
|
-
}
|
|
319
|
-
export declare function defineModel<T, M extends PropertyKey = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
|
|
320
|
-
export declare function defineModel<T, M extends PropertyKey = string>(name: string, options: {
|
|
315
|
+
} | {
|
|
321
316
|
required: true;
|
|
322
|
-
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
323
|
-
export declare function defineModel<T, M extends PropertyKey = string>(
|
|
317
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
318
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
319
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
324
320
|
default: any;
|
|
325
|
-
}
|
|
326
|
-
|
|
321
|
+
} | {
|
|
322
|
+
required: true;
|
|
323
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
324
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
327
325
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
328
326
|
type MappedOmit<T, K extends keyof any> = {
|
|
329
327
|
[P in keyof T as P extends K ? never : P]: T[P];
|
|
@@ -959,7 +957,7 @@ export type ComponentOptionsWithArrayProps<PropNames extends string = string, Ra
|
|
|
959
957
|
/**
|
|
960
958
|
* @deprecated
|
|
961
959
|
*/
|
|
962
|
-
export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions
|
|
960
|
+
export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions>> & Readonly<EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & {
|
|
963
961
|
props: PropsOptions & ThisType<void>;
|
|
964
962
|
} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>;
|
|
965
963
|
|
|
@@ -993,7 +991,7 @@ export declare function defineComponent<Props extends Record<string, any>, E ext
|
|
|
993
991
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
994
992
|
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = unknown extends TypeProps ? string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
995
993
|
[key in RuntimePropsKeys]?: any;
|
|
996
|
-
} : TypeProps, ResolvedProps = Readonly<InferredProps & EmitsToProps<ResolvedEmits>>, TypeRefs extends Record<string, unknown> = {}>(options: {
|
|
994
|
+
} : TypeProps, ResolvedProps = Readonly<InferredProps> & Readonly<EmitsToProps<ResolvedEmits>>, TypeRefs extends Record<string, unknown> = {}>(options: {
|
|
997
995
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
998
996
|
/**
|
|
999
997
|
* @private for language-tools use only
|
|
@@ -1519,7 +1517,7 @@ export declare function defineAsyncComponent<T extends Component = {
|
|
|
1519
1517
|
new (): ComponentPublicInstance;
|
|
1520
1518
|
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
1521
1519
|
|
|
1522
|
-
export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: DefineModelOptions<T[K]>): ModelRef<T[K], M>;
|
|
1520
|
+
export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T, G = T[K], S = T[K]>(props: T, name: K, options?: DefineModelOptions<T[K], G, S>): ModelRef<T[K], M, G, S>;
|
|
1523
1521
|
|
|
1524
1522
|
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
|
1525
1523
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { pauseTracking, resetTracking, isRef, toRaw, traverse, isReactive, ref, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, shallowRef, readonly, isShallow, isReadonly } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
8
|
+
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -1148,7 +1148,9 @@ const BaseTransitionImpl = {
|
|
|
1148
1148
|
// #11061, ensure enterHooks is fresh after clone
|
|
1149
1149
|
(hooks) => enterHooks = hooks
|
|
1150
1150
|
);
|
|
1151
|
-
|
|
1151
|
+
if (innerChild.type !== Comment) {
|
|
1152
|
+
setTransitionHooks(innerChild, enterHooks);
|
|
1153
|
+
}
|
|
1152
1154
|
const oldChild = instance.subTree;
|
|
1153
1155
|
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
1154
1156
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
@@ -1472,10 +1474,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1472
1474
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
1473
1475
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1474
1476
|
const setupState = owner.setupState;
|
|
1477
|
+
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
|
|
1475
1478
|
if (oldRef != null && oldRef !== ref) {
|
|
1476
1479
|
if (isString(oldRef)) {
|
|
1477
1480
|
refs[oldRef] = null;
|
|
1478
|
-
if (
|
|
1481
|
+
if (canSetSetupRef(oldRef)) {
|
|
1479
1482
|
setupState[oldRef] = null;
|
|
1480
1483
|
}
|
|
1481
1484
|
} else if (isRef(oldRef)) {
|
|
@@ -1490,14 +1493,14 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1490
1493
|
if (_isString || _isRef) {
|
|
1491
1494
|
const doSet = () => {
|
|
1492
1495
|
if (rawRef.f) {
|
|
1493
|
-
const existing = _isString ?
|
|
1496
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1494
1497
|
if (isUnmount) {
|
|
1495
1498
|
isArray(existing) && remove(existing, refValue);
|
|
1496
1499
|
} else {
|
|
1497
1500
|
if (!isArray(existing)) {
|
|
1498
1501
|
if (_isString) {
|
|
1499
1502
|
refs[ref] = [refValue];
|
|
1500
|
-
if (
|
|
1503
|
+
if (canSetSetupRef(ref)) {
|
|
1501
1504
|
setupState[ref] = refs[ref];
|
|
1502
1505
|
}
|
|
1503
1506
|
} else {
|
|
@@ -1510,7 +1513,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1510
1513
|
}
|
|
1511
1514
|
} else if (_isString) {
|
|
1512
1515
|
refs[ref] = value;
|
|
1513
|
-
if (
|
|
1516
|
+
if (canSetSetupRef(ref)) {
|
|
1514
1517
|
setupState[ref] = value;
|
|
1515
1518
|
}
|
|
1516
1519
|
} else if (_isRef) {
|
|
@@ -1871,8 +1874,7 @@ Server rendered element contains more child nodes than client vdom.`
|
|
|
1871
1874
|
const isText = vnode.type === Text;
|
|
1872
1875
|
if (node) {
|
|
1873
1876
|
if (isText && !optimized) {
|
|
1874
|
-
|
|
1875
|
-
if (next && (next = normalizeVNode(next)).type === Text) {
|
|
1877
|
+
if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
|
|
1876
1878
|
insert(
|
|
1877
1879
|
createText(
|
|
1878
1880
|
node.data.slice(vnode.children.length)
|
|
@@ -2128,7 +2130,10 @@ function resolveCssVars(instance, vnode, expectedMap) {
|
|
|
2128
2130
|
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2129
2131
|
const cssVars = instance.getCssVars();
|
|
2130
2132
|
for (const key in cssVars) {
|
|
2131
|
-
expectedMap.set(
|
|
2133
|
+
expectedMap.set(
|
|
2134
|
+
`--${getEscapedCssVarName(key, false)}`,
|
|
2135
|
+
String(cssVars[key])
|
|
2136
|
+
);
|
|
2132
2137
|
}
|
|
2133
2138
|
}
|
|
2134
2139
|
if (vnode === root && instance.parent) {
|
|
@@ -8273,7 +8278,7 @@ function isMemoSame(cached, memo) {
|
|
|
8273
8278
|
return true;
|
|
8274
8279
|
}
|
|
8275
8280
|
|
|
8276
|
-
const version = "3.5.
|
|
8281
|
+
const version = "3.5.1";
|
|
8277
8282
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8278
8283
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8279
8284
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/
|
|
50
|
-
"@vue/
|
|
49
|
+
"@vue/shared": "3.5.1",
|
|
50
|
+
"@vue/reactivity": "3.5.1"
|
|
51
51
|
}
|
|
52
52
|
}
|