@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 === '';
|
|
@@ -267,7 +267,7 @@ const isIntegerKey = (key) => isString(key) &&
|
|
|
267
267
|
'' + parseInt(key, 10) === key;
|
|
268
268
|
const isReservedProp = /*#__PURE__*/ makeMap(
|
|
269
269
|
// the leading comma is intentional so empty string "" is also included
|
|
270
|
-
',key,ref,' +
|
|
270
|
+
',key,ref,ref_for,ref_key,' +
|
|
271
271
|
'onVnodeBeforeMount,onVnodeMounted,' +
|
|
272
272
|
'onVnodeBeforeUpdate,onVnodeUpdated,' +
|
|
273
273
|
'onVnodeBeforeUnmount,onVnodeUnmounted');
|
|
@@ -456,7 +456,7 @@ const targetMap = new WeakMap();
|
|
|
456
456
|
let effectTrackDepth = 0;
|
|
457
457
|
let trackOpBit = 1;
|
|
458
458
|
/**
|
|
459
|
-
* The bitwise track markers support at most 30 levels
|
|
459
|
+
* The bitwise track markers support at most 30 levels of recursion.
|
|
460
460
|
* This value is chosen to enable modern JS engines to use a SMI on all platforms.
|
|
461
461
|
* When recursion depth is greater, fall back to using a full cleanup.
|
|
462
462
|
*/
|
|
@@ -785,7 +785,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
|
785
785
|
function createSetter(shallow = false) {
|
|
786
786
|
return function set(target, key, value, receiver) {
|
|
787
787
|
let oldValue = target[key];
|
|
788
|
-
if (!shallow) {
|
|
788
|
+
if (!shallow && !isReadonly(value)) {
|
|
789
789
|
value = toRaw(value);
|
|
790
790
|
oldValue = toRaw(oldValue);
|
|
791
791
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
@@ -1377,21 +1377,25 @@ function toRefs(object) {
|
|
|
1377
1377
|
return ret;
|
|
1378
1378
|
}
|
|
1379
1379
|
class ObjectRefImpl {
|
|
1380
|
-
constructor(_object, _key) {
|
|
1380
|
+
constructor(_object, _key, _defaultValue) {
|
|
1381
1381
|
this._object = _object;
|
|
1382
1382
|
this._key = _key;
|
|
1383
|
+
this._defaultValue = _defaultValue;
|
|
1383
1384
|
this.__v_isRef = true;
|
|
1384
1385
|
}
|
|
1385
1386
|
get value() {
|
|
1386
|
-
|
|
1387
|
+
const val = this._object[this._key];
|
|
1388
|
+
return val === undefined ? this._defaultValue : val;
|
|
1387
1389
|
}
|
|
1388
1390
|
set value(newVal) {
|
|
1389
1391
|
this._object[this._key] = newVal;
|
|
1390
1392
|
}
|
|
1391
1393
|
}
|
|
1392
|
-
function toRef(object, key) {
|
|
1394
|
+
function toRef(object, key, defaultValue) {
|
|
1393
1395
|
const val = object[key];
|
|
1394
|
-
return isRef(val)
|
|
1396
|
+
return isRef(val)
|
|
1397
|
+
? val
|
|
1398
|
+
: new ObjectRefImpl(object, key, defaultValue);
|
|
1395
1399
|
}
|
|
1396
1400
|
|
|
1397
1401
|
class ComputedRefImpl {
|
|
@@ -1599,6 +1603,7 @@ function emit(event, ...args) {
|
|
|
1599
1603
|
}
|
|
1600
1604
|
}
|
|
1601
1605
|
function setDevtoolsHook(hook, target) {
|
|
1606
|
+
var _a, _b;
|
|
1602
1607
|
devtools = hook;
|
|
1603
1608
|
if (devtools) {
|
|
1604
1609
|
devtools.enabled = true;
|
|
@@ -1611,7 +1616,10 @@ function setDevtoolsHook(hook, target) {
|
|
|
1611
1616
|
// (#4815)
|
|
1612
1617
|
// eslint-disable-next-line no-restricted-globals
|
|
1613
1618
|
typeof window !== 'undefined' &&
|
|
1614
|
-
|
|
1619
|
+
// some envs mock window but not fully
|
|
1620
|
+
window.HTMLElement &&
|
|
1621
|
+
// also exclude jsdom
|
|
1622
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1615
1623
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1616
1624
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1617
1625
|
replay.push((newHook) => {
|
|
@@ -1834,11 +1842,6 @@ const deprecationData = {
|
|
|
1834
1842
|
`Use "${newHook}" instead.`,
|
|
1835
1843
|
link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
|
|
1836
1844
|
},
|
|
1837
|
-
["V_FOR_REF" /* V_FOR_REF */]: {
|
|
1838
|
-
message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
|
|
1839
|
-
`Consider using function refs or refactor to avoid ref usage altogether.`,
|
|
1840
|
-
link: `https://v3.vuejs.org/guide/migration/array-refs.html`
|
|
1841
|
-
},
|
|
1842
1845
|
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
1843
1846
|
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
1844
1847
|
`Use kebab-case key name modifiers instead.`,
|
|
@@ -3249,7 +3252,9 @@ const BaseTransitionImpl = {
|
|
|
3249
3252
|
const rawProps = toRaw(props);
|
|
3250
3253
|
const { mode } = rawProps;
|
|
3251
3254
|
// check mode
|
|
3252
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
3255
|
+
if ((process.env.NODE_ENV !== 'production') &&
|
|
3256
|
+
mode &&
|
|
3257
|
+
mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
|
|
3253
3258
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3254
3259
|
}
|
|
3255
3260
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3895,7 +3900,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
3895
3900
|
}
|
|
3896
3901
|
current = current.parent;
|
|
3897
3902
|
}
|
|
3898
|
-
hook();
|
|
3903
|
+
return hook();
|
|
3899
3904
|
});
|
|
3900
3905
|
injectHook(type, wrappedHook, target);
|
|
3901
3906
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -4680,7 +4685,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
4680
4685
|
continue;
|
|
4681
4686
|
}
|
|
4682
4687
|
}
|
|
4683
|
-
if (value !== attrs[key]) {
|
|
4688
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
4684
4689
|
attrs[key] = value;
|
|
4685
4690
|
hasAttrsChanged = true;
|
|
4686
4691
|
}
|
|
@@ -5263,7 +5268,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5263
5268
|
return vm;
|
|
5264
5269
|
}
|
|
5265
5270
|
}
|
|
5266
|
-
Vue.version = "3.2.
|
|
5271
|
+
Vue.version = "3.2.25";
|
|
5267
5272
|
Vue.config = singletonApp.config;
|
|
5268
5273
|
Vue.use = (p, ...options) => {
|
|
5269
5274
|
if (p && isFunction(p.install)) {
|
|
@@ -5616,7 +5621,7 @@ const methodsToPatch = [
|
|
|
5616
5621
|
];
|
|
5617
5622
|
const patched = new WeakSet();
|
|
5618
5623
|
function defineReactive(obj, key, val) {
|
|
5619
|
-
// it's possible for the
|
|
5624
|
+
// it's possible for the original object to be mutated after being defined
|
|
5620
5625
|
// and expecting reactivity... we are covering it here because this seems to
|
|
5621
5626
|
// be a bit more common.
|
|
5622
5627
|
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
@@ -5839,6 +5844,102 @@ function createAppAPI(render, hydrate) {
|
|
|
5839
5844
|
};
|
|
5840
5845
|
}
|
|
5841
5846
|
|
|
5847
|
+
/**
|
|
5848
|
+
* Function for handling a template ref
|
|
5849
|
+
*/
|
|
5850
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
5851
|
+
if (isArray(rawRef)) {
|
|
5852
|
+
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
5853
|
+
return;
|
|
5854
|
+
}
|
|
5855
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
5856
|
+
// when mounting async components, nothing needs to be done,
|
|
5857
|
+
// because the template ref is forwarded to inner component
|
|
5858
|
+
return;
|
|
5859
|
+
}
|
|
5860
|
+
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
5861
|
+
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
5862
|
+
: vnode.el;
|
|
5863
|
+
const value = isUnmount ? null : refValue;
|
|
5864
|
+
const { i: owner, r: ref } = rawRef;
|
|
5865
|
+
if ((process.env.NODE_ENV !== 'production') && !owner) {
|
|
5866
|
+
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
5867
|
+
`A vnode with ref must be created inside the render function.`);
|
|
5868
|
+
return;
|
|
5869
|
+
}
|
|
5870
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
5871
|
+
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
5872
|
+
const setupState = owner.setupState;
|
|
5873
|
+
// dynamic ref changed. unset old ref
|
|
5874
|
+
if (oldRef != null && oldRef !== ref) {
|
|
5875
|
+
if (isString(oldRef)) {
|
|
5876
|
+
refs[oldRef] = null;
|
|
5877
|
+
if (hasOwn(setupState, oldRef)) {
|
|
5878
|
+
setupState[oldRef] = null;
|
|
5879
|
+
}
|
|
5880
|
+
}
|
|
5881
|
+
else if (isRef(oldRef)) {
|
|
5882
|
+
oldRef.value = null;
|
|
5883
|
+
}
|
|
5884
|
+
}
|
|
5885
|
+
if (isFunction(ref)) {
|
|
5886
|
+
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
5887
|
+
}
|
|
5888
|
+
else {
|
|
5889
|
+
const _isString = isString(ref);
|
|
5890
|
+
const _isRef = isRef(ref);
|
|
5891
|
+
if (_isString || _isRef) {
|
|
5892
|
+
const doSet = () => {
|
|
5893
|
+
if (rawRef.f) {
|
|
5894
|
+
const existing = _isString ? refs[ref] : ref.value;
|
|
5895
|
+
if (isUnmount) {
|
|
5896
|
+
isArray(existing) && remove(existing, refValue);
|
|
5897
|
+
}
|
|
5898
|
+
else {
|
|
5899
|
+
if (!isArray(existing)) {
|
|
5900
|
+
if (_isString) {
|
|
5901
|
+
refs[ref] = [refValue];
|
|
5902
|
+
}
|
|
5903
|
+
else {
|
|
5904
|
+
ref.value = [refValue];
|
|
5905
|
+
if (rawRef.k)
|
|
5906
|
+
refs[rawRef.k] = ref.value;
|
|
5907
|
+
}
|
|
5908
|
+
}
|
|
5909
|
+
else if (!existing.includes(refValue)) {
|
|
5910
|
+
existing.push(refValue);
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
}
|
|
5914
|
+
else if (_isString) {
|
|
5915
|
+
refs[ref] = value;
|
|
5916
|
+
if (hasOwn(setupState, ref)) {
|
|
5917
|
+
setupState[ref] = value;
|
|
5918
|
+
}
|
|
5919
|
+
}
|
|
5920
|
+
else if (isRef(ref)) {
|
|
5921
|
+
ref.value = value;
|
|
5922
|
+
if (rawRef.k)
|
|
5923
|
+
refs[rawRef.k] = value;
|
|
5924
|
+
}
|
|
5925
|
+
else if ((process.env.NODE_ENV !== 'production')) {
|
|
5926
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
5927
|
+
}
|
|
5928
|
+
};
|
|
5929
|
+
if (value) {
|
|
5930
|
+
doSet.id = -1;
|
|
5931
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
5932
|
+
}
|
|
5933
|
+
else {
|
|
5934
|
+
doSet();
|
|
5935
|
+
}
|
|
5936
|
+
}
|
|
5937
|
+
else if ((process.env.NODE_ENV !== 'production')) {
|
|
5938
|
+
warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
5939
|
+
}
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
|
|
5842
5943
|
let hasMismatch = false;
|
|
5843
5944
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
5844
5945
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
@@ -6227,45 +6328,7 @@ function initFeatureFlags() {
|
|
|
6227
6328
|
`which expects these compile-time feature flags to be globally injected ` +
|
|
6228
6329
|
`via the bundler config in order to get better tree-shaking in the ` +
|
|
6229
6330
|
`production bundle.\n\n` +
|
|
6230
|
-
`For more details, see
|
|
6231
|
-
}
|
|
6232
|
-
}
|
|
6233
|
-
|
|
6234
|
-
function convertLegacyRefInFor(vnode) {
|
|
6235
|
-
// refInFor
|
|
6236
|
-
if (vnode.props && vnode.props.refInFor) {
|
|
6237
|
-
delete vnode.props.refInFor;
|
|
6238
|
-
if (vnode.ref) {
|
|
6239
|
-
if (isArray(vnode.ref)) {
|
|
6240
|
-
vnode.ref.forEach(r => (r.f = true));
|
|
6241
|
-
}
|
|
6242
|
-
else {
|
|
6243
|
-
vnode.ref.f = true;
|
|
6244
|
-
}
|
|
6245
|
-
}
|
|
6246
|
-
}
|
|
6247
|
-
}
|
|
6248
|
-
function registerLegacyRef(refs, key, value, owner, isInFor, isUnmount) {
|
|
6249
|
-
const existing = refs[key];
|
|
6250
|
-
if (isUnmount) {
|
|
6251
|
-
if (isArray(existing)) {
|
|
6252
|
-
remove(existing, value);
|
|
6253
|
-
}
|
|
6254
|
-
else {
|
|
6255
|
-
refs[key] = null;
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
else if (isInFor) {
|
|
6259
|
-
(process.env.NODE_ENV !== 'production') && warnDeprecation("V_FOR_REF" /* V_FOR_REF */, owner);
|
|
6260
|
-
if (!isArray(existing)) {
|
|
6261
|
-
refs[key] = [value];
|
|
6262
|
-
}
|
|
6263
|
-
else if (!existing.includes(value)) {
|
|
6264
|
-
existing.push(value);
|
|
6265
|
-
}
|
|
6266
|
-
}
|
|
6267
|
-
else {
|
|
6268
|
-
refs[key] = value;
|
|
6331
|
+
`For more details, see https://link.vuejs.org/feature-flags.`);
|
|
6269
6332
|
}
|
|
6270
6333
|
}
|
|
6271
6334
|
|
|
@@ -6555,12 +6618,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6555
6618
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
6556
6619
|
const newProps = n2.props || EMPTY_OBJ;
|
|
6557
6620
|
let vnodeHook;
|
|
6621
|
+
// disable recurse in beforeUpdate hooks
|
|
6622
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
6558
6623
|
if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
|
|
6559
6624
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
6560
6625
|
}
|
|
6561
6626
|
if (dirs) {
|
|
6562
6627
|
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
|
|
6563
6628
|
}
|
|
6629
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
6564
6630
|
if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {
|
|
6565
6631
|
// HMR updated, force full diff
|
|
6566
6632
|
patchFlag = 0;
|
|
@@ -6844,7 +6910,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6844
6910
|
const { el, props } = initialVNode;
|
|
6845
6911
|
const { bm, m, parent } = instance;
|
|
6846
6912
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
6847
|
-
|
|
6913
|
+
toggleRecurse(instance, false);
|
|
6848
6914
|
// beforeMount hook
|
|
6849
6915
|
if (bm) {
|
|
6850
6916
|
invokeArrayFns(bm);
|
|
@@ -6857,7 +6923,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6857
6923
|
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6858
6924
|
instance.emit('hook:beforeMount');
|
|
6859
6925
|
}
|
|
6860
|
-
|
|
6926
|
+
toggleRecurse(instance, true);
|
|
6861
6927
|
if (el && hydrateNode) {
|
|
6862
6928
|
// vnode has adopted host node - perform hydration instead of mount.
|
|
6863
6929
|
const hydrateSubTree = () => {
|
|
@@ -6945,7 +7011,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6945
7011
|
pushWarningContext(next || instance.vnode);
|
|
6946
7012
|
}
|
|
6947
7013
|
// Disallow component effect recursion during pre-lifecycle hooks.
|
|
6948
|
-
|
|
7014
|
+
toggleRecurse(instance, false);
|
|
6949
7015
|
if (next) {
|
|
6950
7016
|
next.el = vnode.el;
|
|
6951
7017
|
updateComponentPreRender(instance, next, optimized);
|
|
@@ -6964,7 +7030,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6964
7030
|
if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
|
|
6965
7031
|
instance.emit('hook:beforeUpdate');
|
|
6966
7032
|
}
|
|
6967
|
-
|
|
7033
|
+
toggleRecurse(instance, true);
|
|
6968
7034
|
// render
|
|
6969
7035
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
6970
7036
|
startMeasure(instance, `render`);
|
|
@@ -7013,13 +7079,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7013
7079
|
}
|
|
7014
7080
|
};
|
|
7015
7081
|
// create reactive effect for rendering
|
|
7016
|
-
const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
7017
|
-
);
|
|
7082
|
+
const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
7083
|
+
));
|
|
7018
7084
|
const update = (instance.update = effect.run.bind(effect));
|
|
7019
7085
|
update.id = instance.uid;
|
|
7020
7086
|
// allowRecurse
|
|
7021
7087
|
// #1801, #2043 component render effects should allow recursive updates
|
|
7022
|
-
|
|
7088
|
+
toggleRecurse(instance, true);
|
|
7023
7089
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
7024
7090
|
effect.onTrack = instance.rtc
|
|
7025
7091
|
? e => invokeArrayFns(instance.rtc, e)
|
|
@@ -7549,88 +7615,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7549
7615
|
createApp: createAppAPI(render, hydrate)
|
|
7550
7616
|
};
|
|
7551
7617
|
}
|
|
7552
|
-
function
|
|
7553
|
-
|
|
7554
|
-
rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
7555
|
-
return;
|
|
7556
|
-
}
|
|
7557
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
7558
|
-
// when mounting async components, nothing needs to be done,
|
|
7559
|
-
// because the template ref is forwarded to inner component
|
|
7560
|
-
return;
|
|
7561
|
-
}
|
|
7562
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
7563
|
-
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
7564
|
-
: vnode.el;
|
|
7565
|
-
const value = isUnmount ? null : refValue;
|
|
7566
|
-
const { i: owner, r: ref } = rawRef;
|
|
7567
|
-
if ((process.env.NODE_ENV !== 'production') && !owner) {
|
|
7568
|
-
warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
7569
|
-
`A vnode with ref must be created inside the render function.`);
|
|
7570
|
-
return;
|
|
7571
|
-
}
|
|
7572
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
7573
|
-
const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
7574
|
-
const setupState = owner.setupState;
|
|
7575
|
-
// dynamic ref changed. unset old ref
|
|
7576
|
-
if (oldRef != null && oldRef !== ref) {
|
|
7577
|
-
if (isString(oldRef)) {
|
|
7578
|
-
refs[oldRef] = null;
|
|
7579
|
-
if (hasOwn(setupState, oldRef)) {
|
|
7580
|
-
setupState[oldRef] = null;
|
|
7581
|
-
}
|
|
7582
|
-
}
|
|
7583
|
-
else if (isRef(oldRef)) {
|
|
7584
|
-
oldRef.value = null;
|
|
7585
|
-
}
|
|
7586
|
-
}
|
|
7587
|
-
if (isString(ref)) {
|
|
7588
|
-
const doSet = () => {
|
|
7589
|
-
if (isCompatEnabled("V_FOR_REF" /* V_FOR_REF */, owner)) {
|
|
7590
|
-
registerLegacyRef(refs, ref, refValue, owner, rawRef.f, isUnmount);
|
|
7591
|
-
}
|
|
7592
|
-
else {
|
|
7593
|
-
refs[ref] = value;
|
|
7594
|
-
}
|
|
7595
|
-
if (hasOwn(setupState, ref)) {
|
|
7596
|
-
setupState[ref] = value;
|
|
7597
|
-
}
|
|
7598
|
-
};
|
|
7599
|
-
// #1789: for non-null values, set them after render
|
|
7600
|
-
// null values means this is unmount and it should not overwrite another
|
|
7601
|
-
// ref with the same key
|
|
7602
|
-
if (value) {
|
|
7603
|
-
doSet.id = -1;
|
|
7604
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
7605
|
-
}
|
|
7606
|
-
else {
|
|
7607
|
-
doSet();
|
|
7608
|
-
}
|
|
7609
|
-
}
|
|
7610
|
-
else if (isRef(ref)) {
|
|
7611
|
-
const doSet = () => {
|
|
7612
|
-
ref.value = value;
|
|
7613
|
-
};
|
|
7614
|
-
if (value) {
|
|
7615
|
-
doSet.id = -1;
|
|
7616
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
7617
|
-
}
|
|
7618
|
-
else {
|
|
7619
|
-
doSet();
|
|
7620
|
-
}
|
|
7621
|
-
}
|
|
7622
|
-
else if (isFunction(ref)) {
|
|
7623
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
7624
|
-
}
|
|
7625
|
-
else if ((process.env.NODE_ENV !== 'production')) {
|
|
7626
|
-
warn$1('Invalid template ref type:', value, `(${typeof value})`);
|
|
7627
|
-
}
|
|
7628
|
-
}
|
|
7629
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
7630
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
7631
|
-
vnode,
|
|
7632
|
-
prevVNode
|
|
7633
|
-
]);
|
|
7618
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
7619
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
7634
7620
|
}
|
|
7635
7621
|
/**
|
|
7636
7622
|
* #1156
|
|
@@ -7640,8 +7626,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
7640
7626
|
*
|
|
7641
7627
|
* #2080
|
|
7642
7628
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
7643
|
-
* the children will always moved
|
|
7644
|
-
*
|
|
7629
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
7630
|
+
* position, el should be inherited from previous nodes.
|
|
7645
7631
|
*/
|
|
7646
7632
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
7647
7633
|
const ch1 = n1.children;
|
|
@@ -8283,6 +8269,7 @@ function convertLegacyFunctionalComponent(comp) {
|
|
|
8283
8269
|
};
|
|
8284
8270
|
Func.props = comp.props;
|
|
8285
8271
|
Func.displayName = comp.name;
|
|
8272
|
+
Func.compatConfig = comp.compatConfig;
|
|
8286
8273
|
// v2 functional components do not inherit attrs
|
|
8287
8274
|
Func.inheritAttrs = false;
|
|
8288
8275
|
normalizedFunctionalComponentMap.set(comp, Func);
|
|
@@ -8429,10 +8416,10 @@ const createVNodeWithArgsTransform = (...args) => {
|
|
|
8429
8416
|
};
|
|
8430
8417
|
const InternalObjectKey = `__vInternal`;
|
|
8431
8418
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
8432
|
-
const normalizeRef = ({ ref }) => {
|
|
8419
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
8433
8420
|
return (ref != null
|
|
8434
8421
|
? isString(ref) || isRef(ref) || isFunction(ref)
|
|
8435
|
-
? { i: currentRenderingInstance, r: ref }
|
|
8422
|
+
? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
|
|
8436
8423
|
: ref
|
|
8437
8424
|
: null);
|
|
8438
8425
|
};
|
|
@@ -8500,7 +8487,6 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8500
8487
|
}
|
|
8501
8488
|
{
|
|
8502
8489
|
convertLegacyVModelProps(vnode);
|
|
8503
|
-
convertLegacyRefInFor(vnode);
|
|
8504
8490
|
defineLegacyVNodeProperties(vnode);
|
|
8505
8491
|
}
|
|
8506
8492
|
return vnode;
|
|
@@ -8773,7 +8759,8 @@ function mergeProps(...args) {
|
|
|
8773
8759
|
else if (isOn(key)) {
|
|
8774
8760
|
const existing = ret[key];
|
|
8775
8761
|
const incoming = toMerge[key];
|
|
8776
|
-
if (existing !== incoming
|
|
8762
|
+
if (existing !== incoming &&
|
|
8763
|
+
!(isArray(existing) && existing.includes(incoming))) {
|
|
8777
8764
|
ret[key] = existing
|
|
8778
8765
|
? [].concat(existing, incoming)
|
|
8779
8766
|
: incoming;
|
|
@@ -8785,6 +8772,12 @@ function mergeProps(...args) {
|
|
|
8785
8772
|
}
|
|
8786
8773
|
}
|
|
8787
8774
|
return ret;
|
|
8775
|
+
}
|
|
8776
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
8777
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
8778
|
+
vnode,
|
|
8779
|
+
prevVNode
|
|
8780
|
+
]);
|
|
8788
8781
|
}
|
|
8789
8782
|
|
|
8790
8783
|
function getCompatChildren(instance) {
|
|
@@ -9218,23 +9211,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
9218
9211
|
const n = accessCache[key];
|
|
9219
9212
|
if (n !== undefined) {
|
|
9220
9213
|
switch (n) {
|
|
9221
|
-
case
|
|
9214
|
+
case 1 /* SETUP */:
|
|
9222
9215
|
return setupState[key];
|
|
9223
|
-
case
|
|
9216
|
+
case 2 /* DATA */:
|
|
9224
9217
|
return data[key];
|
|
9225
|
-
case
|
|
9218
|
+
case 4 /* CONTEXT */:
|
|
9226
9219
|
return ctx[key];
|
|
9227
|
-
case
|
|
9220
|
+
case 3 /* PROPS */:
|
|
9228
9221
|
return props[key];
|
|
9229
9222
|
// default: just fallthrough
|
|
9230
9223
|
}
|
|
9231
9224
|
}
|
|
9232
9225
|
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
9233
|
-
accessCache[key] =
|
|
9226
|
+
accessCache[key] = 1 /* SETUP */;
|
|
9234
9227
|
return setupState[key];
|
|
9235
9228
|
}
|
|
9236
9229
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
9237
|
-
accessCache[key] =
|
|
9230
|
+
accessCache[key] = 2 /* DATA */;
|
|
9238
9231
|
return data[key];
|
|
9239
9232
|
}
|
|
9240
9233
|
else if (
|
|
@@ -9242,15 +9235,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
9242
9235
|
// props
|
|
9243
9236
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
9244
9237
|
hasOwn(normalizedProps, key)) {
|
|
9245
|
-
accessCache[key] =
|
|
9238
|
+
accessCache[key] = 3 /* PROPS */;
|
|
9246
9239
|
return props[key];
|
|
9247
9240
|
}
|
|
9248
9241
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9249
|
-
accessCache[key] =
|
|
9242
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9250
9243
|
return ctx[key];
|
|
9251
9244
|
}
|
|
9252
9245
|
else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
|
|
9253
|
-
accessCache[key] =
|
|
9246
|
+
accessCache[key] = 0 /* OTHER */;
|
|
9254
9247
|
}
|
|
9255
9248
|
}
|
|
9256
9249
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -9271,7 +9264,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9271
9264
|
}
|
|
9272
9265
|
else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
9273
9266
|
// user may set custom properties to `this` that start with `$`
|
|
9274
|
-
accessCache[key] =
|
|
9267
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
9275
9268
|
return ctx[key];
|
|
9276
9269
|
}
|
|
9277
9270
|
else if (
|
|
@@ -9342,7 +9335,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
9342
9335
|
},
|
|
9343
9336
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
9344
9337
|
let normalizedProps;
|
|
9345
|
-
return (accessCache[key]
|
|
9338
|
+
return (!!accessCache[key] ||
|
|
9346
9339
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
9347
9340
|
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
|
|
9348
9341
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
@@ -9448,6 +9441,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
9448
9441
|
root: null,
|
|
9449
9442
|
next: null,
|
|
9450
9443
|
subTree: null,
|
|
9444
|
+
effect: null,
|
|
9451
9445
|
update: null,
|
|
9452
9446
|
scope: new EffectScope(true /* detached */),
|
|
9453
9447
|
render: null,
|
|
@@ -10967,7 +10961,7 @@ function isMemoSame(cached, memo) {
|
|
|
10967
10961
|
}
|
|
10968
10962
|
|
|
10969
10963
|
// Core API ------------------------------------------------------------------
|
|
10970
|
-
const version = "3.2.
|
|
10964
|
+
const version = "3.2.25";
|
|
10971
10965
|
const _ssrUtils = {
|
|
10972
10966
|
createComponentInstance,
|
|
10973
10967
|
setupComponent,
|
|
@@ -11242,12 +11236,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11242
11236
|
el[key] = value == null ? '' : value;
|
|
11243
11237
|
return;
|
|
11244
11238
|
}
|
|
11245
|
-
if (key === 'value' &&
|
|
11239
|
+
if (key === 'value' &&
|
|
11240
|
+
el.tagName !== 'PROGRESS' &&
|
|
11241
|
+
// custom elements may use _value internally
|
|
11242
|
+
!el.tagName.includes('-')) {
|
|
11246
11243
|
// store value as _value as well since
|
|
11247
11244
|
// non-string values will be stringified.
|
|
11248
11245
|
el._value = value;
|
|
11249
11246
|
const newValue = value == null ? '' : value;
|
|
11250
|
-
if (el.value !== newValue
|
|
11247
|
+
if (el.value !== newValue ||
|
|
11248
|
+
// #4956: always set for OPTION elements because its value falls back to
|
|
11249
|
+
// textContent if no value attribute is present. And setting .value for
|
|
11250
|
+
// OPTION has no side effect
|
|
11251
|
+
el.tagName === 'OPTION') {
|
|
11251
11252
|
el.value = newValue;
|
|
11252
11253
|
}
|
|
11253
11254
|
if (value == null) {
|
|
@@ -11644,7 +11645,7 @@ class VueElement extends BaseClass {
|
|
|
11644
11645
|
// HMR
|
|
11645
11646
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
11646
11647
|
instance.ceReload = newStyles => {
|
|
11647
|
-
//
|
|
11648
|
+
// always reset styles
|
|
11648
11649
|
if (this._styles) {
|
|
11649
11650
|
this._styles.forEach(s => this.shadowRoot.removeChild(s));
|
|
11650
11651
|
this._styles.length = 0;
|