@vue/compat 3.2.21 → 3.2.25
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/README.md +1 -0
- package/dist/vue.cjs.js +247 -242
- package/dist/vue.cjs.prod.js +234 -222
- package/dist/vue.esm-browser.js +222 -221
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +224 -222
- package/dist/vue.global.js +222 -221
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +167 -167
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +169 -168
- package/dist/vue.runtime.global.js +167 -167
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
|
@@ -34,7 +34,7 @@ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomo
|
|
|
34
34
|
const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
|
|
35
35
|
/**
|
|
36
36
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
37
|
-
* e.g.
|
|
37
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
38
38
|
*/
|
|
39
39
|
function includeBooleanAttr(value) {
|
|
40
40
|
return !!value || value === '';
|
|
@@ -266,7 +266,7 @@ const isIntegerKey = (key) => isString(key) &&
|
|
|
266
266
|
'' + parseInt(key, 10) === key;
|
|
267
267
|
const isReservedProp = /*#__PURE__*/ makeMap(
|
|
268
268
|
// the leading comma is intentional so empty string "" is also included
|
|
269
|
-
',key,ref,' +
|
|
269
|
+
',key,ref,ref_for,ref_key,' +
|
|
270
270
|
'onVnodeBeforeMount,onVnodeMounted,' +
|
|
271
271
|
'onVnodeBeforeUpdate,onVnodeUpdated,' +
|
|
272
272
|
'onVnodeBeforeUnmount,onVnodeUnmounted');
|
|
@@ -455,7 +455,7 @@ const targetMap = new WeakMap();
|
|
|
455
455
|
let effectTrackDepth = 0;
|
|
456
456
|
let trackOpBit = 1;
|
|
457
457
|
/**
|
|
458
|
-
* The bitwise track markers support at most 30 levels
|
|
458
|
+
* The bitwise track markers support at most 30 levels of recursion.
|
|
459
459
|
* This value is chosen to enable modern JS engines to use a SMI on all platforms.
|
|
460
460
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
461
461
|
*/
|
|
@@ -776,7 +776,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
776
776
|
function createSetter(shallow = false) {
|
|
777
777
|
return function set(target, key, value, receiver) {
|
|
778
778
|
let oldValue = target[key];
|
|
779
|
-
if (!shallow) {
|
|
779
|
+
if (!shallow && !isReadonly(value)) {
|
|
780
780
|
value = toRaw(value);
|
|
781
781
|
oldValue = toRaw(oldValue);
|
|
782
782
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
@@ -1361,21 +1361,25 @@ function toRefs(object) {
|
|
|
1361
1361
|
return ret;
|
|
1362
1362
|
}
|
|
1363
1363
|
class ObjectRefImpl {
|
|
1364
|
-
constructor(_object, _key) {
|
|
1364
|
+
constructor(_object, _key, _defaultValue) {
|
|
1365
1365
|
this._object = _object;
|
|
1366
1366
|
this._key = _key;
|
|
1367
|
+
this._defaultValue = _defaultValue;
|
|
1367
1368
|
this.__v_isRef = true;
|
|
1368
1369
|
}
|
|
1369
1370
|
get value() {
|
|
1370
|
-
|
|
1371
|
+
const val = this._object[this._key];
|
|
1372
|
+
return val === undefined ? this._defaultValue : val;
|
|
1371
1373
|
}
|
|
1372
1374
|
set value(newVal) {
|
|
1373
1375
|
this._object[this._key] = newVal;
|
|
1374
1376
|
}
|
|
1375
1377
|
}
|
|
1376
|
-
function toRef(object, key) {
|
|
1378
|
+
function toRef(object, key, defaultValue) {
|
|
1377
1379
|
const val = object[key];
|
|
1378
|
-
return isRef(val)
|
|
1380
|
+
return isRef(val)
|
|
1381
|
+
? val
|
|
1382
|
+
: new ObjectRefImpl(object, key, defaultValue);
|
|
1379
1383
|
}
|
|
1380
1384
|
|
|
1381
1385
|
class ComputedRefImpl {
|
|
@@ -1582,6 +1586,7 @@ function emit(event, ...args) {
|
|
|
1582
1586
|
}
|
|
1583
1587
|
}
|
|
1584
1588
|
function setDevtoolsHook(hook, target) {
|
|
1589
|
+
var _a, _b;
|
|
1585
1590
|
devtools = hook;
|
|
1586
1591
|
if (devtools) {
|
|
1587
1592
|
devtools.enabled = true;
|
|
@@ -1594,7 +1599,10 @@ function setDevtoolsHook(hook, target) {
|
|
|
1594
1599
|
// (#4815)
|
|
1595
1600
|
// eslint-disable-next-line no-restricted-globals
|
|
1596
1601
|
typeof window !== 'undefined' &&
|
|
1597
|
-
|
|
1602
|
+
// some envs mock window but not fully
|
|
1603
|
+
window.HTMLElement &&
|
|
1604
|
+
// also exclude jsdom
|
|
1605
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1598
1606
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1599
1607
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1600
1608
|
replay.push((newHook) => {
|
|
@@ -1817,11 +1825,6 @@ const deprecationData = {
|
|
|
1817
1825
|
`Use "${newHook}" instead.`,
|
|
1818
1826
|
link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
|
|
1819
1827
|
},
|
|
1820
|
-
["V_FOR_REF" /* V_FOR_REF */]: {
|
|
1821
|
-
message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
|
|
1822
|
-
`Consider using function refs or refactor to avoid ref usage altogether.`,
|
|
1823
|
-
link: `https://v3.vuejs.org/guide/migration/array-refs.html`
|
|
1824
|
-
},
|
|
1825
1828
|
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
1826
1829
|
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
1827
1830
|
`Use kebab-case key name modifiers instead.`,
|
|
@@ -3228,7 +3231,8 @@ const BaseTransitionImpl = {
|
|
|
3228
3231
|
const rawProps = toRaw(props);
|
|
3229
3232
|
const { mode } = rawProps;
|
|
3230
3233
|
// check mode
|
|
3231
|
-
if (mode &&
|
|
3234
|
+
if (mode &&
|
|
3235
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
3232
3236
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3233
3237
|
}
|
|
3234
3238
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3874,7 +3878,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3874
3878
|
}
|
|
3875
3879
|
current = current.parent;
|
|
3876
3880
|
}
|
|
3877
|
-
hook();
|
|
3881
|
+
return hook();
|
|
3878
3882
|
});
|
|
3879
3883
|
injectHook(type, wrappedHook, target);
|
|
3880
3884
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -4652,7 +4656,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
4652
4656
|
continue;
|
|
4653
4657
|
}
|
|
4654
4658
|
}
|
|
4655
|
-
if (value !== attrs[key]) {
|
|
4659
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
4656
4660
|
attrs[key] = value;
|
|
4657
4661
|
hasAttrsChanged = true;
|
|
4658
4662
|
}
|
|
@@ -5233,7 +5237,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5233
5237
|
return vm;
|
|
5234
5238
|
}
|
|
5235
5239
|
}
|
|
5236
|
-
Vue.version = "3.2.
|
|
5240
|
+
Vue.version = "3.2.25";
|
|
5237
5241
|
Vue.config = singletonApp.config;
|
|
5238
5242
|
Vue.use = (p, ...options) => {
|
|
5239
5243
|
if (p && isFunction(p.install)) {
|
|
@@ -5584,7 +5588,7 @@ const methodsToPatch = [
|
|
|
5584
5588
|
];
|
|
5585
5589
|
const patched = new WeakSet();
|
|
5586
5590
|
function defineReactive(obj, key, val) {
|
|
5587
|
-
// it's possible for the
|
|
5591
|
+
// it's possible for the original object to be mutated after being defined
|
|
5588
5592
|
// and expecting reactivity... we are covering it here because this seems to
|
|
5589
5593
|
// be a bit more common.
|
|
5590
5594
|
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
@@ -5804,6 +5808,102 @@ function createAppAPI(render, hydrate) {
|
|
|
5804
5808
|
};
|
|
5805
5809
|
}
|
|
5806
5810
|
|
|
5811
|
+
/**
|
|
5812
|
+
* Function for handling a template ref
|
|
5813
|
+
*/
|
|
5814
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
5815
|
+
if (isArray(rawRef)) {
|
|
5816
|
+
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
5817
|
+
return;
|
|
5818
|
+
}
|
|
5819
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
5820
|
+
// when mounting async components, nothing needs to be done,
|
|
5821
|
+
// because the template ref is forwarded to inner component
|
|
5822
|
+
return;
|
|
5823
|
+
}
|
|
5824
|
+
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
5825
|
+
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
5826
|
+
: vnode.el;
|
|
5827
|
+
const value = isUnmount ? null : refValue;
|
|
5828
|
+
const { i: owner, r: ref } = rawRef;
|
|
5829
|
+
if (!owner) {
|
|
5830
|
+
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
5831
|
+
`A vnode with ref must be created inside the render function.`);
|
|
5832
|
+
return;
|
|
5833
|
+
}
|
|
5834
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
5835
|
+
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
5836
|
+
const setupState = owner.setupState;
|
|
5837
|
+
// dynamic ref changed. unset old ref
|
|
5838
|
+
if (oldRef != null && oldRef !== ref) {
|
|
5839
|
+
if (isString(oldRef)) {
|
|
5840
|
+
refs[oldRef] = null;
|
|
5841
|
+
if (hasOwn(setupState, oldRef)) {
|
|
5842
|
+
setupState[oldRef] = null;
|
|
5843
|
+
}
|
|
5844
|
+
}
|
|
5845
|
+
else if (isRef(oldRef)) {
|
|
5846
|
+
oldRef.value = null;
|
|
5847
|
+
}
|
|
5848
|
+
}
|
|
5849
|
+
if (isFunction(ref)) {
|
|
5850
|
+
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
5851
|
+
}
|
|
5852
|
+
else {
|
|
5853
|
+
const _isString = isString(ref);
|
|
5854
|
+
const _isRef = isRef(ref);
|
|
5855
|
+
if (_isString || _isRef) {
|
|
5856
|
+
const doSet = () => {
|
|
5857
|
+
if (rawRef.f) {
|
|
5858
|
+
const existing = _isString ? refs[ref] : ref.value;
|
|
5859
|
+
if (isUnmount) {
|
|
5860
|
+
isArray(existing) && remove(existing, refValue);
|
|
5861
|
+
}
|
|
5862
|
+
else {
|
|
5863
|
+
if (!isArray(existing)) {
|
|
5864
|
+
if (_isString) {
|
|
5865
|
+
refs[ref] = [refValue];
|
|
5866
|
+
}
|
|
5867
|
+
else {
|
|
5868
|
+
ref.value = [refValue];
|
|
5869
|
+
if (rawRef.k)
|
|
5870
|
+
refs[rawRef.k] = ref.value;
|
|
5871
|
+
}
|
|
5872
|
+
}
|
|
5873
|
+
else if (!existing.includes(refValue)) {
|
|
5874
|
+
existing.push(refValue);
|
|
5875
|
+
}
|
|
5876
|
+
}
|
|
5877
|
+
}
|
|
5878
|
+
else if (_isString) {
|
|
5879
|
+
refs[ref] = value;
|
|
5880
|
+
if (hasOwn(setupState, ref)) {
|
|
5881
|
+
setupState[ref] = value;
|
|
5882
|
+
}
|
|
5883
|
+
}
|
|
5884
|
+
else if (isRef(ref)) {
|
|
5885
|
+
ref.value = value;
|
|
5886
|
+
if (rawRef.k)
|
|
5887
|
+
refs[rawRef.k] = value;
|
|
5888
|
+
}
|
|
5889
|
+
else {
|
|
5890
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
5891
|
+
}
|
|
5892
|
+
};
|
|
5893
|
+
if (value) {
|
|
5894
|
+
doSet.id = -1;
|
|
5895
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
5896
|
+
}
|
|
5897
|
+
else {
|
|
5898
|
+
doSet();
|
|
5899
|
+
}
|
|
5900
|
+
}
|
|
5901
|
+
else {
|
|
5902
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5807
5907
|
let hasMismatch = false;
|
|
5808
5908
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
5809
5909
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
@@ -6165,44 +6265,6 @@ function isSupported() {
|
|
|
6165
6265
|
return supported;
|
|
6166
6266
|
}
|
|
6167
6267
|
|
|
6168
|
-
function convertLegacyRefInFor(vnode) {
|
|
6169
|
-
// refInFor
|
|
6170
|
-
if (vnode.props && vnode.props.refInFor) {
|
|
6171
|
-
delete vnode.props.refInFor;
|
|
6172
|
-
if (vnode.ref) {
|
|
6173
|
-
if (isArray(vnode.ref)) {
|
|
6174
|
-
vnode.ref.forEach(r => (r.f = true));
|
|
6175
|
-
}
|
|
6176
|
-
else {
|
|
6177
|
-
vnode.ref.f = true;
|
|
6178
|
-
}
|
|
6179
|
-
}
|
|
6180
|
-
}
|
|
6181
|
-
}
|
|
6182
|
-
function registerLegacyRef(refs, key, value, owner, isInFor, isUnmount) {
|
|
6183
|
-
const existing = refs[key];
|
|
6184
|
-
if (isUnmount) {
|
|
6185
|
-
if (isArray(existing)) {
|
|
6186
|
-
remove(existing, value);
|
|
6187
|
-
}
|
|
6188
|
-
else {
|
|
6189
|
-
refs[key] = null;
|
|
6190
|
-
}
|
|
6191
|
-
}
|
|
6192
|
-
else if (isInFor) {
|
|
6193
|
-
warnDeprecation("V_FOR_REF" /* V_FOR_REF */, owner);
|
|
6194
|
-
if (!isArray(existing)) {
|
|
6195
|
-
refs[key] = [value];
|
|
6196
|
-
}
|
|
6197
|
-
else if (!existing.includes(value)) {
|
|
6198
|
-
existing.push(value);
|
|
6199
|
-
}
|
|
6200
|
-
}
|
|
6201
|
-
else {
|
|
6202
|
-
refs[key] = value;
|
|
6203
|
-
}
|
|
6204
|
-
}
|
|
6205
|
-
|
|
6206
6268
|
const queuePostRenderEffect = queueEffectWithSuspense
|
|
6207
6269
|
;
|
|
6208
6270
|
/**
|
|
@@ -6474,12 +6536,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6474
6536
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
6475
6537
|
const newProps = n2.props || EMPTY_OBJ;
|
|
6476
6538
|
let vnodeHook;
|
|
6539
|
+
// disable recurse in beforeUpdate hooks
|
|
6540
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
6477
6541
|
if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
|
|
6478
6542
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6479
6543
|
}
|
|
6480
6544
|
if (dirs) {
|
|
6481
6545
|
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
|
|
6482
6546
|
}
|
|
6547
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
6483
6548
|
if (isHmrUpdating) {
|
|
6484
6549
|
// HMR updated, force full diff
|
|
6485
6550
|
patchFlag = 0;
|
|
@@ -6763,7 +6828,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6763
6828
|
const { el, props } = initialVNode;
|
|
6764
6829
|
const { bm, m, parent } = instance;
|
|
6765
6830
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
6766
|
-
|
|
6831
|
+
toggleRecurse(instance, false);
|
|
6767
6832
|
// beforeMount hook
|
|
6768
6833
|
if (bm) {
|
|
6769
6834
|
invokeArrayFns(bm);
|
|
@@ -6776,7 +6841,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6776
6841
|
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6777
6842
|
instance.emit('hook:beforeMount');
|
|
6778
6843
|
}
|
|
6779
|
-
|
|
6844
|
+
toggleRecurse(instance, true);
|
|
6780
6845
|
if (el && hydrateNode) {
|
|
6781
6846
|
// vnode has adopted host node - perform hydration instead of mount.
|
|
6782
6847
|
const hydrateSubTree = () => {
|
|
@@ -6864,7 +6929,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6864
6929
|
pushWarningContext(next || instance.vnode);
|
|
6865
6930
|
}
|
|
6866
6931
|
// Disallow component effect recursion during pre-lifecycle hooks.
|
|
6867
|
-
|
|
6932
|
+
toggleRecurse(instance, false);
|
|
6868
6933
|
if (next) {
|
|
6869
6934
|
next.el = vnode.el;
|
|
6870
6935
|
updateComponentPreRender(instance, next, optimized);
|
|
@@ -6883,7 +6948,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6883
6948
|
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6884
6949
|
instance.emit('hook:beforeUpdate');
|
|
6885
6950
|
}
|
|
6886
|
-
|
|
6951
|
+
toggleRecurse(instance, true);
|
|
6887
6952
|
// render
|
|
6888
6953
|
{
|
|
6889
6954
|
startMeasure(instance, `render`);
|
|
@@ -6932,13 +6997,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6932
6997
|
}
|
|
6933
6998
|
};
|
|
6934
6999
|
// create reactive effect for rendering
|
|
6935
|
-
const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
6936
|
-
);
|
|
7000
|
+
const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
7001
|
+
));
|
|
6937
7002
|
const update = (instance.update = effect.run.bind(effect));
|
|
6938
7003
|
update.id = instance.uid;
|
|
6939
7004
|
// allowRecurse
|
|
6940
7005
|
// #1801, #2043 component render effects should allow recursive updates
|
|
6941
|
-
|
|
7006
|
+
toggleRecurse(instance, true);
|
|
6942
7007
|
{
|
|
6943
7008
|
effect.onTrack = instance.rtc
|
|
6944
7009
|
? e => invokeArrayFns(instance.rtc, e)
|
|
@@ -7468,88 +7533,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7468
7533
|
createApp: createAppAPI(render, hydrate)
|
|
7469
7534
|
};
|
|
7470
7535
|
}
|
|
7471
|
-
function
|
|
7472
|
-
|
|
7473
|
-
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
7474
|
-
return;
|
|
7475
|
-
}
|
|
7476
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
7477
|
-
// when mounting async components, nothing needs to be done,
|
|
7478
|
-
// because the template ref is forwarded to inner component
|
|
7479
|
-
return;
|
|
7480
|
-
}
|
|
7481
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
7482
|
-
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
7483
|
-
: vnode.el;
|
|
7484
|
-
const value = isUnmount ? null : refValue;
|
|
7485
|
-
const { i: owner, r: ref } = rawRef;
|
|
7486
|
-
if (!owner) {
|
|
7487
|
-
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7488
|
-
`A vnode with ref must be created inside the render function.`);
|
|
7489
|
-
return;
|
|
7490
|
-
}
|
|
7491
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
7492
|
-
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
7493
|
-
const setupState = owner.setupState;
|
|
7494
|
-
// dynamic ref changed. unset old ref
|
|
7495
|
-
if (oldRef != null && oldRef !== ref) {
|
|
7496
|
-
if (isString(oldRef)) {
|
|
7497
|
-
refs[oldRef] = null;
|
|
7498
|
-
if (hasOwn(setupState, oldRef)) {
|
|
7499
|
-
setupState[oldRef] = null;
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
else if (isRef(oldRef)) {
|
|
7503
|
-
oldRef.value = null;
|
|
7504
|
-
}
|
|
7505
|
-
}
|
|
7506
|
-
if (isString(ref)) {
|
|
7507
|
-
const doSet = () => {
|
|
7508
|
-
if (isCompatEnabled("V_FOR_REF" /* V_FOR_REF */, owner)) {
|
|
7509
|
-
registerLegacyRef(refs, ref, refValue, owner, rawRef.f, isUnmount);
|
|
7510
|
-
}
|
|
7511
|
-
else {
|
|
7512
|
-
refs[ref] = value;
|
|
7513
|
-
}
|
|
7514
|
-
if (hasOwn(setupState, ref)) {
|
|
7515
|
-
setupState[ref] = value;
|
|
7516
|
-
}
|
|
7517
|
-
};
|
|
7518
|
-
// #1789: for non-null values, set them after render
|
|
7519
|
-
// null values means this is unmount and it should not overwrite another
|
|
7520
|
-
// ref with the same key
|
|
7521
|
-
if (value) {
|
|
7522
|
-
doSet.id = -1;
|
|
7523
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
7524
|
-
}
|
|
7525
|
-
else {
|
|
7526
|
-
doSet();
|
|
7527
|
-
}
|
|
7528
|
-
}
|
|
7529
|
-
else if (isRef(ref)) {
|
|
7530
|
-
const doSet = () => {
|
|
7531
|
-
ref.value = value;
|
|
7532
|
-
};
|
|
7533
|
-
if (value) {
|
|
7534
|
-
doSet.id = -1;
|
|
7535
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
7536
|
-
}
|
|
7537
|
-
else {
|
|
7538
|
-
doSet();
|
|
7539
|
-
}
|
|
7540
|
-
}
|
|
7541
|
-
else if (isFunction(ref)) {
|
|
7542
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
7543
|
-
}
|
|
7544
|
-
else {
|
|
7545
|
-
warn$1('Invalid template ref type:', value, `(${typeof value})`);
|
|
7546
|
-
}
|
|
7547
|
-
}
|
|
7548
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
7549
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
7550
|
-
vnode,
|
|
7551
|
-
prevVNode
|
|
7552
|
-
]);
|
|
7536
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
7537
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
7553
7538
|
}
|
|
7554
7539
|
/**
|
|
7555
7540
|
* #1156
|
|
@@ -7559,8 +7544,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7559
7544
|
*
|
|
7560
7545
|
* #2080
|
|
7561
7546
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
7562
|
-
* the children will always moved
|
|
7563
|
-
*
|
|
7547
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
7548
|
+
* position, el should be inherited from previous nodes.
|
|
7564
7549
|
*/
|
|
7565
7550
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
7566
7551
|
const ch1 = n1.children;
|
|
@@ -8198,6 +8183,7 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
8198
8183
|
};
|
|
8199
8184
|
Func.props = comp.props;
|
|
8200
8185
|
Func.displayName = comp.name;
|
|
8186
|
+
Func.compatConfig = comp.compatConfig;
|
|
8201
8187
|
// v2 functional components do not inherit attrs
|
|
8202
8188
|
Func.inheritAttrs = false;
|
|
8203
8189
|
normalizedFunctionalComponentMap.set(comp, Func);
|
|
@@ -8343,10 +8329,10 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
8343
8329
|
};
|
|
8344
8330
|
const InternalObjectKey = `__vInternal`;
|
|
8345
8331
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
8346
|
-
const normalizeRef = ({ ref }) => {
|
|
8332
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
8347
8333
|
return (ref != null
|
|
8348
8334
|
? isString(ref) || isRef(ref) || isFunction(ref)
|
|
8349
|
-
? { i: currentRenderingInstance, r: ref }
|
|
8335
|
+
? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
|
|
8350
8336
|
: ref
|
|
8351
8337
|
: null);
|
|
8352
8338
|
};
|
|
@@ -8414,7 +8400,6 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8414
8400
|
}
|
|
8415
8401
|
{
|
|
8416
8402
|
convertLegacyVModelProps(vnode);
|
|
8417
|
-
convertLegacyRefInFor(vnode);
|
|
8418
8403
|
defineLegacyVNodeProperties(vnode);
|
|
8419
8404
|
}
|
|
8420
8405
|
return vnode;
|
|
@@ -8687,7 +8672,8 @@ function mergeProps(...args) {
|
|
|
8687
8672
|
else if (isOn(key)) {
|
|
8688
8673
|
const existing = ret[key];
|
|
8689
8674
|
const incoming = toMerge[key];
|
|
8690
|
-
if (existing !== incoming
|
|
8675
|
+
if (existing !== incoming &&
|
|
8676
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
8691
8677
|
ret[key] = existing
|
|
8692
8678
|
? [].concat(existing, incoming)
|
|
8693
8679
|
: incoming;
|
|
@@ -8699,6 +8685,12 @@ function mergeProps(...args) {
|
|
|
8699
8685
|
}
|
|
8700
8686
|
}
|
|
8701
8687
|
return ret;
|
|
8688
|
+
}
|
|
8689
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
8690
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
8691
|
+
vnode,
|
|
8692
|
+
prevVNode
|
|
8693
|
+
]);
|
|
8702
8694
|
}
|
|
8703
8695
|
|
|
8704
8696
|
function getCompatChildren(instance) {
|
|
@@ -9131,23 +9123,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
9131
9123
|
const n = accessCache[key];
|
|
9132
9124
|
if (n !== undefined) {
|
|
9133
9125
|
switch (n) {
|
|
9134
|
-
case
|
|
9126
|
+
case 1 /* SETUP */:
|
|
9135
9127
|
return setupState[key];
|
|
9136
|
-
case
|
|
9128
|
+
case 2 /* DATA */:
|
|
9137
9129
|
return data[key];
|
|
9138
|
-
case
|
|
9130
|
+
case 4 /* CONTEXT */:
|
|
9139
9131
|
return ctx[key];
|
|
9140
|
-
case
|
|
9132
|
+
case 3 /* PROPS */:
|
|
9141
9133
|
return props[key];
|
|
9142
9134
|
// default: just fallthrough
|
|
9143
9135
|
}
|
|
9144
9136
|
}
|
|
9145
9137
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
9146
|
-
accessCache[key] =
|
|
9138
|
+
accessCache[key] = 1 /* SETUP */;
|
|
9147
9139
|
return setupState[key];
|
|
9148
9140
|
}
|
|
9149
9141
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
9150
|
-
accessCache[key] =
|
|
9142
|
+
accessCache[key] = 2 /* DATA */;
|
|
9151
9143
|
return data[key];
|
|
9152
9144
|
}
|
|
9153
9145
|
else if (
|
|
@@ -9155,15 +9147,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
9155
9147
|
// props
|
|
9156
9148
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
9157
9149
|
hasOwn(normalizedProps, key)) {
|
|
9158
|
-
accessCache[key] =
|
|
9150
|
+
accessCache[key] = 3 /* PROPS */;
|
|
9159
9151
|
return props[key];
|
|
9160
9152
|
}
|
|
9161
9153
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9162
|
-
accessCache[key] =
|
|
9154
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9163
9155
|
return ctx[key];
|
|
9164
9156
|
}
|
|
9165
9157
|
else if (shouldCacheAccess) {
|
|
9166
|
-
accessCache[key] =
|
|
9158
|
+
accessCache[key] = 0 /* OTHER */;
|
|
9167
9159
|
}
|
|
9168
9160
|
}
|
|
9169
9161
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -9184,7 +9176,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9184
9176
|
}
|
|
9185
9177
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9186
9178
|
// user may set custom properties to `this` that start with `$`
|
|
9187
|
-
accessCache[key] =
|
|
9179
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9188
9180
|
return ctx[key];
|
|
9189
9181
|
}
|
|
9190
9182
|
else if (
|
|
@@ -9252,7 +9244,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9252
9244
|
},
|
|
9253
9245
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
9254
9246
|
let normalizedProps;
|
|
9255
|
-
return (accessCache[key]
|
|
9247
|
+
return (!!accessCache[key] ||
|
|
9256
9248
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
9257
9249
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
9258
9250
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -9358,6 +9350,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
9358
9350
|
root: null,
|
|
9359
9351
|
next: null,
|
|
9360
9352
|
subTree: null,
|
|
9353
|
+
effect: null,
|
|
9361
9354
|
update: null,
|
|
9362
9355
|
scope: new EffectScope(true /* detached */),
|
|
9363
9356
|
render: null,
|
|
@@ -10827,7 +10820,7 @@ function isMemoSame(cached, memo) {
|
|
|
10827
10820
|
}
|
|
10828
10821
|
|
|
10829
10822
|
// Core API ------------------------------------------------------------------
|
|
10830
|
-
const version = "3.2.
|
|
10823
|
+
const version = "3.2.25";
|
|
10831
10824
|
/**
|
|
10832
10825
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
10833
10826
|
* @internal
|
|
@@ -11094,12 +11087,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11094
11087
|
el[key] = value == null ? '' : value;
|
|
11095
11088
|
return;
|
|
11096
11089
|
}
|
|
11097
|
-
if (key === 'value' &&
|
|
11090
|
+
if (key === 'value' &&
|
|
11091
|
+
el.tagName !== 'PROGRESS' &&
|
|
11092
|
+
// custom elements may use _value internally
|
|
11093
|
+
!el.tagName.includes('-')) {
|
|
11098
11094
|
// store value as _value as well since
|
|
11099
11095
|
// non-string values will be stringified.
|
|
11100
11096
|
el._value = value;
|
|
11101
11097
|
const newValue = value == null ? '' : value;
|
|
11102
|
-
if (el.value !== newValue
|
|
11098
|
+
if (el.value !== newValue ||
|
|
11099
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
11100
|
+
// textContent if no value attribute is present. And setting .value for
|
|
11101
|
+
// OPTION has no side effect
|
|
11102
|
+
el.tagName === 'OPTION') {
|
|
11103
11103
|
el.value = newValue;
|
|
11104
11104
|
}
|
|
11105
11105
|
if (value == null) {
|
|
@@ -11495,7 +11495,7 @@ class VueElement extends BaseClass {
|
|
|
11495
11495
|
// HMR
|
|
11496
11496
|
{
|
|
11497
11497
|
instance.ceReload = newStyles => {
|
|
11498
|
-
//
|
|
11498
|
+
// always reset styles
|
|
11499
11499
|
if (this._styles) {
|
|
11500
11500
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
11501
11501
|
this._styles.length = 0;
|