@vue/compat 3.2.38 → 3.2.40
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 -1
- package/dist/vue.cjs.js +141 -120
- package/dist/vue.cjs.prod.js +138 -127
- package/dist/vue.esm-browser.js +129 -120
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +128 -129
- package/dist/vue.global.js +129 -120
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +74 -78
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +73 -87
- package/dist/vue.runtime.global.js +74 -78
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +7 -2
|
@@ -1818,7 +1818,9 @@ function queuePostFlushCb(cb) {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
queueFlush();
|
|
1820
1820
|
}
|
|
1821
|
-
function flushPreFlushCbs(seen,
|
|
1821
|
+
function flushPreFlushCbs(seen,
|
|
1822
|
+
// if currently flushing, skip the current job itself
|
|
1823
|
+
i = isFlushing ? flushIndex + 1 : 0) {
|
|
1822
1824
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
1823
1825
|
seen = seen || new Map();
|
|
1824
1826
|
}
|
|
@@ -4792,7 +4794,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4792
4794
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4793
4795
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4794
4796
|
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4795
|
-
injectHook(lifecycle, hook, target);
|
|
4797
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
4796
4798
|
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4797
4799
|
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4798
4800
|
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
@@ -5344,7 +5346,10 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5344
5346
|
slots[slot.name] = slot.key
|
|
5345
5347
|
? (...args) => {
|
|
5346
5348
|
const res = slot.fn(...args);
|
|
5347
|
-
|
|
5349
|
+
// attach branch key so each conditional branch is considered a
|
|
5350
|
+
// different fragment
|
|
5351
|
+
if (res)
|
|
5352
|
+
res.key = slot.key;
|
|
5348
5353
|
return res;
|
|
5349
5354
|
}
|
|
5350
5355
|
: slot.fn;
|
|
@@ -7124,7 +7129,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7124
7129
|
return vm;
|
|
7125
7130
|
}
|
|
7126
7131
|
}
|
|
7127
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7132
|
+
Vue.version = `2.6.14-compat:${"3.2.40"}`;
|
|
7128
7133
|
Vue.config = singletonApp.config;
|
|
7129
7134
|
Vue.use = (p, ...options) => {
|
|
7130
7135
|
if (p && isFunction(p.install)) {
|
|
@@ -7841,7 +7846,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7841
7846
|
const isFragmentStart = isComment(node) && node.data === '[';
|
|
7842
7847
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
7843
7848
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7844
|
-
|
|
7849
|
+
let domType = node.nodeType;
|
|
7845
7850
|
vnode.el = node;
|
|
7846
7851
|
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7847
7852
|
optimized = false;
|
|
@@ -7882,10 +7887,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7882
7887
|
}
|
|
7883
7888
|
break;
|
|
7884
7889
|
case Static:
|
|
7885
|
-
if (
|
|
7886
|
-
|
|
7890
|
+
if (isFragmentStart) {
|
|
7891
|
+
// entire template is static but SSRed as a fragment
|
|
7892
|
+
node = nextSibling(node);
|
|
7893
|
+
domType = node.nodeType;
|
|
7887
7894
|
}
|
|
7888
|
-
|
|
7895
|
+
if (domType === 1 /* DOMNodeTypes.ELEMENT */ || domType === 3 /* DOMNodeTypes.TEXT */) {
|
|
7889
7896
|
// determine anchor, adopt content
|
|
7890
7897
|
nextNode = node;
|
|
7891
7898
|
// if the static vnode has its content stripped during build,
|
|
@@ -7902,7 +7909,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7902
7909
|
}
|
|
7903
7910
|
nextNode = nextSibling(nextNode);
|
|
7904
7911
|
}
|
|
7905
|
-
return nextNode;
|
|
7912
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
7913
|
+
}
|
|
7914
|
+
else {
|
|
7915
|
+
onMismatch();
|
|
7906
7916
|
}
|
|
7907
7917
|
break;
|
|
7908
7918
|
case Fragment:
|
|
@@ -8260,7 +8270,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8260
8270
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
8261
8271
|
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
8262
8272
|
}
|
|
8263
|
-
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP,
|
|
8273
|
+
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options;
|
|
8264
8274
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
8265
8275
|
// style in order to prevent being inlined by minifiers.
|
|
8266
8276
|
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = (process.env.NODE_ENV !== 'production') && isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
@@ -8387,56 +8397,44 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8387
8397
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8388
8398
|
let el;
|
|
8389
8399
|
let vnodeHook;
|
|
8390
|
-
const { type, props, shapeFlag, transition,
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
// Only static vnodes can be reused, so its mounted DOM nodes should be
|
|
8397
|
-
// exactly the same, and we can simply do a clone here.
|
|
8398
|
-
// only do this in production since cloned trees cannot be HMR updated.
|
|
8399
|
-
el = vnode.el = hostCloneNode(vnode.el);
|
|
8400
|
+
const { type, props, shapeFlag, transition, dirs } = vnode;
|
|
8401
|
+
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
8402
|
+
// mount children first, since some props may rely on child content
|
|
8403
|
+
// being already rendered, e.g. `<select value>`
|
|
8404
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8405
|
+
hostSetElementText(el, vnode.children);
|
|
8400
8406
|
}
|
|
8401
|
-
else {
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8407
|
+
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8408
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
8409
|
+
}
|
|
8410
|
+
if (dirs) {
|
|
8411
|
+
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8412
|
+
}
|
|
8413
|
+
// props
|
|
8414
|
+
if (props) {
|
|
8415
|
+
for (const key in props) {
|
|
8416
|
+
if (key !== 'value' && !isReservedProp(key)) {
|
|
8417
|
+
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8418
|
+
}
|
|
8410
8419
|
}
|
|
8411
|
-
|
|
8412
|
-
|
|
8420
|
+
/**
|
|
8421
|
+
* Special case for setting value on DOM elements:
|
|
8422
|
+
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8423
|
+
* - it needs to be forced (#1471)
|
|
8424
|
+
* #2353 proposes adding another renderer option to configure this, but
|
|
8425
|
+
* the properties affects are so finite it is worth special casing it
|
|
8426
|
+
* here to reduce the complexity. (Special casing it also should not
|
|
8427
|
+
* affect non-DOM renderers)
|
|
8428
|
+
*/
|
|
8429
|
+
if ('value' in props) {
|
|
8430
|
+
hostPatchProp(el, 'value', null, props.value);
|
|
8413
8431
|
}
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
for (const key in props) {
|
|
8417
|
-
if (key !== 'value' && !isReservedProp(key)) {
|
|
8418
|
-
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8419
|
-
}
|
|
8420
|
-
}
|
|
8421
|
-
/**
|
|
8422
|
-
* Special case for setting value on DOM elements:
|
|
8423
|
-
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8424
|
-
* - it needs to be forced (#1471)
|
|
8425
|
-
* #2353 proposes adding another renderer option to configure this, but
|
|
8426
|
-
* the properties affects are so finite it is worth special casing it
|
|
8427
|
-
* here to reduce the complexity. (Special casing it also should not
|
|
8428
|
-
* affect non-DOM renderers)
|
|
8429
|
-
*/
|
|
8430
|
-
if ('value' in props) {
|
|
8431
|
-
hostPatchProp(el, 'value', null, props.value);
|
|
8432
|
-
}
|
|
8433
|
-
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8434
|
-
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8435
|
-
}
|
|
8432
|
+
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8433
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8436
8434
|
}
|
|
8437
|
-
// scopeId
|
|
8438
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8439
8435
|
}
|
|
8436
|
+
// scopeId
|
|
8437
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8440
8438
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
8441
8439
|
Object.defineProperty(el, '__vnode', {
|
|
8442
8440
|
value: vnode,
|
|
@@ -8623,6 +8621,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8623
8621
|
};
|
|
8624
8622
|
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
|
|
8625
8623
|
if (oldProps !== newProps) {
|
|
8624
|
+
if (oldProps !== EMPTY_OBJ) {
|
|
8625
|
+
for (const key in oldProps) {
|
|
8626
|
+
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8627
|
+
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8628
|
+
}
|
|
8629
|
+
}
|
|
8630
|
+
}
|
|
8626
8631
|
for (const key in newProps) {
|
|
8627
8632
|
// empty string is not valid prop
|
|
8628
8633
|
if (isReservedProp(key))
|
|
@@ -8634,13 +8639,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8634
8639
|
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8635
8640
|
}
|
|
8636
8641
|
}
|
|
8637
|
-
if (oldProps !== EMPTY_OBJ) {
|
|
8638
|
-
for (const key in oldProps) {
|
|
8639
|
-
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8640
|
-
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8641
|
-
}
|
|
8642
|
-
}
|
|
8643
|
-
}
|
|
8644
8642
|
if ('value' in newProps) {
|
|
8645
8643
|
hostPatchProp(el, 'value', oldProps.value, newProps.value);
|
|
8646
8644
|
}
|
|
@@ -10267,7 +10265,10 @@ function normalizeVNode(child) {
|
|
|
10267
10265
|
}
|
|
10268
10266
|
// optimized normalization for template-compiled render fns
|
|
10269
10267
|
function cloneIfMounted(child) {
|
|
10270
|
-
return child.el === null
|
|
10268
|
+
return (child.el === null && child.patchFlag !== -1 /* PatchFlags.HOISTED */) ||
|
|
10269
|
+
child.memo
|
|
10270
|
+
? child
|
|
10271
|
+
: cloneVNode(child);
|
|
10271
10272
|
}
|
|
10272
10273
|
function normalizeChildren(vnode, children) {
|
|
10273
10274
|
let type = 0;
|
|
@@ -10625,7 +10626,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10625
10626
|
if (!isSSR && compile && !Component.render) {
|
|
10626
10627
|
const template = (instance.vnode.props &&
|
|
10627
10628
|
instance.vnode.props['inline-template']) ||
|
|
10628
|
-
Component.template
|
|
10629
|
+
Component.template ||
|
|
10630
|
+
resolveMergedOptions(instance).template;
|
|
10629
10631
|
if (template) {
|
|
10630
10632
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
10631
10633
|
startMeasure(instance, `compile`);
|
|
@@ -11204,7 +11206,7 @@ function isMemoSame(cached, memo) {
|
|
|
11204
11206
|
}
|
|
11205
11207
|
|
|
11206
11208
|
// Core API ------------------------------------------------------------------
|
|
11207
|
-
const version = "3.2.
|
|
11209
|
+
const version = "3.2.40";
|
|
11208
11210
|
const _ssrUtils = {
|
|
11209
11211
|
createComponentInstance,
|
|
11210
11212
|
setupComponent,
|
|
@@ -11270,22 +11272,6 @@ const nodeOps = {
|
|
|
11270
11272
|
setScopeId(el, id) {
|
|
11271
11273
|
el.setAttribute(id, '');
|
|
11272
11274
|
},
|
|
11273
|
-
cloneNode(el) {
|
|
11274
|
-
const cloned = el.cloneNode(true);
|
|
11275
|
-
// #3072
|
|
11276
|
-
// - in `patchDOMProp`, we store the actual value in the `el._value` property.
|
|
11277
|
-
// - normally, elements using `:value` bindings will not be hoisted, but if
|
|
11278
|
-
// the bound value is a constant, e.g. `:value="true"` - they do get
|
|
11279
|
-
// hoisted.
|
|
11280
|
-
// - in production, hoisted nodes are cloned when subsequent inserts, but
|
|
11281
|
-
// cloneNode() does not copy the custom property we attached.
|
|
11282
|
-
// - This may need to account for other custom DOM properties we attach to
|
|
11283
|
-
// elements in addition to `_value` in the future.
|
|
11284
|
-
if (`_value` in el) {
|
|
11285
|
-
cloned._value = el._value;
|
|
11286
|
-
}
|
|
11287
|
-
return cloned;
|
|
11288
|
-
},
|
|
11289
11275
|
// __UNSAFE__
|
|
11290
11276
|
// Reason: innerHTML.
|
|
11291
11277
|
// Static content here can only come from compiled templates.
|
|
@@ -11456,14 +11442,14 @@ const isEnumeratedAttr = /*#__PURE__*/ makeMap('contenteditable,draggable,spellc
|
|
|
11456
11442
|
;
|
|
11457
11443
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
11458
11444
|
if (isEnumeratedAttr(key)) {
|
|
11459
|
-
const
|
|
11445
|
+
const v2CoercedValue = value === null
|
|
11460
11446
|
? 'false'
|
|
11461
11447
|
: typeof value !== 'boolean' && value !== undefined
|
|
11462
11448
|
? 'true'
|
|
11463
11449
|
: null;
|
|
11464
|
-
if (
|
|
11465
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value,
|
|
11466
|
-
el.setAttribute(key,
|
|
11450
|
+
if (v2CoercedValue &&
|
|
11451
|
+
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CoercedValue)) {
|
|
11452
|
+
el.setAttribute(key, v2CoercedValue);
|
|
11467
11453
|
return true;
|
|
11468
11454
|
}
|
|
11469
11455
|
}
|
|
@@ -11524,7 +11510,6 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11524
11510
|
}
|
|
11525
11511
|
else if (type === 'number') {
|
|
11526
11512
|
// e.g. <img :width="null">
|
|
11527
|
-
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
11528
11513
|
value = 0;
|
|
11529
11514
|
needRemove = true;
|
|
11530
11515
|
}
|
|
@@ -11548,7 +11533,8 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11548
11533
|
el[key] = value;
|
|
11549
11534
|
}
|
|
11550
11535
|
catch (e) {
|
|
11551
|
-
if
|
|
11536
|
+
// do not warn if value is auto-coerced from nullish values
|
|
11537
|
+
if ((process.env.NODE_ENV !== 'production') && !needRemove) {
|
|
11552
11538
|
warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11553
11539
|
`value ${value} is invalid.`, e);
|
|
11554
11540
|
}
|
|
@@ -1800,7 +1800,9 @@ var Vue = (function () {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
queueFlush();
|
|
1802
1802
|
}
|
|
1803
|
-
function flushPreFlushCbs(seen,
|
|
1803
|
+
function flushPreFlushCbs(seen,
|
|
1804
|
+
// if currently flushing, skip the current job itself
|
|
1805
|
+
i = isFlushing ? flushIndex + 1 : 0) {
|
|
1804
1806
|
{
|
|
1805
1807
|
seen = seen || new Map();
|
|
1806
1808
|
}
|
|
@@ -4738,7 +4740,7 @@ var Vue = (function () {
|
|
|
4738
4740
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4739
4741
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4740
4742
|
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4741
|
-
injectHook(lifecycle, hook, target);
|
|
4743
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
4742
4744
|
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4743
4745
|
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4744
4746
|
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
@@ -5290,7 +5292,10 @@ var Vue = (function () {
|
|
|
5290
5292
|
slots[slot.name] = slot.key
|
|
5291
5293
|
? (...args) => {
|
|
5292
5294
|
const res = slot.fn(...args);
|
|
5293
|
-
|
|
5295
|
+
// attach branch key so each conditional branch is considered a
|
|
5296
|
+
// different fragment
|
|
5297
|
+
if (res)
|
|
5298
|
+
res.key = slot.key;
|
|
5294
5299
|
return res;
|
|
5295
5300
|
}
|
|
5296
5301
|
: slot.fn;
|
|
@@ -7058,7 +7063,7 @@ var Vue = (function () {
|
|
|
7058
7063
|
return vm;
|
|
7059
7064
|
}
|
|
7060
7065
|
}
|
|
7061
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7066
|
+
Vue.version = `2.6.14-compat:${"3.2.40"}`;
|
|
7062
7067
|
Vue.config = singletonApp.config;
|
|
7063
7068
|
Vue.use = (p, ...options) => {
|
|
7064
7069
|
if (p && isFunction(p.install)) {
|
|
@@ -7769,7 +7774,7 @@ var Vue = (function () {
|
|
|
7769
7774
|
const isFragmentStart = isComment(node) && node.data === '[';
|
|
7770
7775
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
7771
7776
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7772
|
-
|
|
7777
|
+
let domType = node.nodeType;
|
|
7773
7778
|
vnode.el = node;
|
|
7774
7779
|
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7775
7780
|
optimized = false;
|
|
@@ -7809,10 +7814,12 @@ var Vue = (function () {
|
|
|
7809
7814
|
}
|
|
7810
7815
|
break;
|
|
7811
7816
|
case Static:
|
|
7812
|
-
if (
|
|
7813
|
-
|
|
7817
|
+
if (isFragmentStart) {
|
|
7818
|
+
// entire template is static but SSRed as a fragment
|
|
7819
|
+
node = nextSibling(node);
|
|
7820
|
+
domType = node.nodeType;
|
|
7814
7821
|
}
|
|
7815
|
-
|
|
7822
|
+
if (domType === 1 /* DOMNodeTypes.ELEMENT */ || domType === 3 /* DOMNodeTypes.TEXT */) {
|
|
7816
7823
|
// determine anchor, adopt content
|
|
7817
7824
|
nextNode = node;
|
|
7818
7825
|
// if the static vnode has its content stripped during build,
|
|
@@ -7829,7 +7836,10 @@ var Vue = (function () {
|
|
|
7829
7836
|
}
|
|
7830
7837
|
nextNode = nextSibling(nextNode);
|
|
7831
7838
|
}
|
|
7832
|
-
return nextNode;
|
|
7839
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
7840
|
+
}
|
|
7841
|
+
else {
|
|
7842
|
+
onMismatch();
|
|
7833
7843
|
}
|
|
7834
7844
|
break;
|
|
7835
7845
|
case Fragment:
|
|
@@ -8154,7 +8164,7 @@ var Vue = (function () {
|
|
|
8154
8164
|
{
|
|
8155
8165
|
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
8156
8166
|
}
|
|
8157
|
-
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP,
|
|
8167
|
+
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options;
|
|
8158
8168
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
8159
8169
|
// style in order to prevent being inlined by minifiers.
|
|
8160
8170
|
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
@@ -8281,46 +8291,44 @@ var Vue = (function () {
|
|
|
8281
8291
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8282
8292
|
let el;
|
|
8283
8293
|
let vnodeHook;
|
|
8284
|
-
const { type, props, shapeFlag, transition,
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
+
const { type, props, shapeFlag, transition, dirs } = vnode;
|
|
8295
|
+
el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
|
|
8296
|
+
// mount children first, since some props may rely on child content
|
|
8297
|
+
// being already rendered, e.g. `<select value>`
|
|
8298
|
+
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
8299
|
+
hostSetElementText(el, vnode.children);
|
|
8300
|
+
}
|
|
8301
|
+
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
8302
|
+
mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
|
|
8303
|
+
}
|
|
8304
|
+
if (dirs) {
|
|
8305
|
+
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
8306
|
+
}
|
|
8307
|
+
// props
|
|
8308
|
+
if (props) {
|
|
8309
|
+
for (const key in props) {
|
|
8310
|
+
if (key !== 'value' && !isReservedProp(key)) {
|
|
8311
|
+
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8312
|
+
}
|
|
8294
8313
|
}
|
|
8295
|
-
|
|
8296
|
-
|
|
8314
|
+
/**
|
|
8315
|
+
* Special case for setting value on DOM elements:
|
|
8316
|
+
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8317
|
+
* - it needs to be forced (#1471)
|
|
8318
|
+
* #2353 proposes adding another renderer option to configure this, but
|
|
8319
|
+
* the properties affects are so finite it is worth special casing it
|
|
8320
|
+
* here to reduce the complexity. (Special casing it also should not
|
|
8321
|
+
* affect non-DOM renderers)
|
|
8322
|
+
*/
|
|
8323
|
+
if ('value' in props) {
|
|
8324
|
+
hostPatchProp(el, 'value', null, props.value);
|
|
8297
8325
|
}
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
for (const key in props) {
|
|
8301
|
-
if (key !== 'value' && !isReservedProp(key)) {
|
|
8302
|
-
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8303
|
-
}
|
|
8304
|
-
}
|
|
8305
|
-
/**
|
|
8306
|
-
* Special case for setting value on DOM elements:
|
|
8307
|
-
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8308
|
-
* - it needs to be forced (#1471)
|
|
8309
|
-
* #2353 proposes adding another renderer option to configure this, but
|
|
8310
|
-
* the properties affects are so finite it is worth special casing it
|
|
8311
|
-
* here to reduce the complexity. (Special casing it also should not
|
|
8312
|
-
* affect non-DOM renderers)
|
|
8313
|
-
*/
|
|
8314
|
-
if ('value' in props) {
|
|
8315
|
-
hostPatchProp(el, 'value', null, props.value);
|
|
8316
|
-
}
|
|
8317
|
-
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8318
|
-
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8319
|
-
}
|
|
8326
|
+
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8327
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8320
8328
|
}
|
|
8321
|
-
// scopeId
|
|
8322
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8323
8329
|
}
|
|
8330
|
+
// scopeId
|
|
8331
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8324
8332
|
{
|
|
8325
8333
|
Object.defineProperty(el, '__vnode', {
|
|
8326
8334
|
value: vnode,
|
|
@@ -8506,6 +8514,13 @@ var Vue = (function () {
|
|
|
8506
8514
|
};
|
|
8507
8515
|
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
|
|
8508
8516
|
if (oldProps !== newProps) {
|
|
8517
|
+
if (oldProps !== EMPTY_OBJ) {
|
|
8518
|
+
for (const key in oldProps) {
|
|
8519
|
+
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8520
|
+
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8521
|
+
}
|
|
8522
|
+
}
|
|
8523
|
+
}
|
|
8509
8524
|
for (const key in newProps) {
|
|
8510
8525
|
// empty string is not valid prop
|
|
8511
8526
|
if (isReservedProp(key))
|
|
@@ -8517,13 +8532,6 @@ var Vue = (function () {
|
|
|
8517
8532
|
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8518
8533
|
}
|
|
8519
8534
|
}
|
|
8520
|
-
if (oldProps !== EMPTY_OBJ) {
|
|
8521
|
-
for (const key in oldProps) {
|
|
8522
|
-
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8523
|
-
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8524
|
-
}
|
|
8525
|
-
}
|
|
8526
|
-
}
|
|
8527
8535
|
if ('value' in newProps) {
|
|
8528
8536
|
hostPatchProp(el, 'value', oldProps.value, newProps.value);
|
|
8529
8537
|
}
|
|
@@ -10143,7 +10151,10 @@ var Vue = (function () {
|
|
|
10143
10151
|
}
|
|
10144
10152
|
// optimized normalization for template-compiled render fns
|
|
10145
10153
|
function cloneIfMounted(child) {
|
|
10146
|
-
return child.el === null
|
|
10154
|
+
return (child.el === null && child.patchFlag !== -1 /* PatchFlags.HOISTED */) ||
|
|
10155
|
+
child.memo
|
|
10156
|
+
? child
|
|
10157
|
+
: cloneVNode(child);
|
|
10147
10158
|
}
|
|
10148
10159
|
function normalizeChildren(vnode, children) {
|
|
10149
10160
|
let type = 0;
|
|
@@ -10493,7 +10504,8 @@ var Vue = (function () {
|
|
|
10493
10504
|
if (!isSSR && compile && !Component.render) {
|
|
10494
10505
|
const template = (instance.vnode.props &&
|
|
10495
10506
|
instance.vnode.props['inline-template']) ||
|
|
10496
|
-
Component.template
|
|
10507
|
+
Component.template ||
|
|
10508
|
+
resolveMergedOptions(instance).template;
|
|
10497
10509
|
if (template) {
|
|
10498
10510
|
{
|
|
10499
10511
|
startMeasure(instance, `compile`);
|
|
@@ -11051,7 +11063,7 @@ var Vue = (function () {
|
|
|
11051
11063
|
}
|
|
11052
11064
|
|
|
11053
11065
|
// Core API ------------------------------------------------------------------
|
|
11054
|
-
const version = "3.2.
|
|
11066
|
+
const version = "3.2.40";
|
|
11055
11067
|
/**
|
|
11056
11068
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11057
11069
|
* @internal
|
|
@@ -11109,22 +11121,6 @@ var Vue = (function () {
|
|
|
11109
11121
|
setScopeId(el, id) {
|
|
11110
11122
|
el.setAttribute(id, '');
|
|
11111
11123
|
},
|
|
11112
|
-
cloneNode(el) {
|
|
11113
|
-
const cloned = el.cloneNode(true);
|
|
11114
|
-
// #3072
|
|
11115
|
-
// - in `patchDOMProp`, we store the actual value in the `el._value` property.
|
|
11116
|
-
// - normally, elements using `:value` bindings will not be hoisted, but if
|
|
11117
|
-
// the bound value is a constant, e.g. `:value="true"` - they do get
|
|
11118
|
-
// hoisted.
|
|
11119
|
-
// - in production, hoisted nodes are cloned when subsequent inserts, but
|
|
11120
|
-
// cloneNode() does not copy the custom property we attached.
|
|
11121
|
-
// - This may need to account for other custom DOM properties we attach to
|
|
11122
|
-
// elements in addition to `_value` in the future.
|
|
11123
|
-
if (`_value` in el) {
|
|
11124
|
-
cloned._value = el._value;
|
|
11125
|
-
}
|
|
11126
|
-
return cloned;
|
|
11127
|
-
},
|
|
11128
11124
|
// __UNSAFE__
|
|
11129
11125
|
// Reason: innerHTML.
|
|
11130
11126
|
// Static content here can only come from compiled templates.
|
|
@@ -11295,14 +11291,14 @@ var Vue = (function () {
|
|
|
11295
11291
|
;
|
|
11296
11292
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
11297
11293
|
if (isEnumeratedAttr(key)) {
|
|
11298
|
-
const
|
|
11294
|
+
const v2CoercedValue = value === null
|
|
11299
11295
|
? 'false'
|
|
11300
11296
|
: typeof value !== 'boolean' && value !== undefined
|
|
11301
11297
|
? 'true'
|
|
11302
11298
|
: null;
|
|
11303
|
-
if (
|
|
11304
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value,
|
|
11305
|
-
el.setAttribute(key,
|
|
11299
|
+
if (v2CoercedValue &&
|
|
11300
|
+
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CoercedValue)) {
|
|
11301
|
+
el.setAttribute(key, v2CoercedValue);
|
|
11306
11302
|
return true;
|
|
11307
11303
|
}
|
|
11308
11304
|
}
|
|
@@ -11363,7 +11359,6 @@ var Vue = (function () {
|
|
|
11363
11359
|
}
|
|
11364
11360
|
else if (type === 'number') {
|
|
11365
11361
|
// e.g. <img :width="null">
|
|
11366
|
-
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
11367
11362
|
value = 0;
|
|
11368
11363
|
needRemove = true;
|
|
11369
11364
|
}
|
|
@@ -11386,7 +11381,8 @@ var Vue = (function () {
|
|
|
11386
11381
|
el[key] = value;
|
|
11387
11382
|
}
|
|
11388
11383
|
catch (e) {
|
|
11389
|
-
|
|
11384
|
+
// do not warn if value is auto-coerced from nullish values
|
|
11385
|
+
if (!needRemove) {
|
|
11390
11386
|
warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11391
11387
|
`value ${value} is invalid.`, e);
|
|
11392
11388
|
}
|