@vue/compat 3.2.39 → 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 +136 -118
- package/dist/vue.cjs.prod.js +133 -125
- package/dist/vue.esm-browser.js +124 -118
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +123 -127
- package/dist/vue.global.js +124 -118
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +69 -76
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +68 -85
- package/dist/vue.runtime.global.js +69 -76
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +7 -2
|
@@ -4794,7 +4794,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4794
4794
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4795
4795
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4796
4796
|
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4797
|
-
injectHook(lifecycle, hook, target);
|
|
4797
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
4798
4798
|
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4799
4799
|
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4800
4800
|
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
@@ -5346,7 +5346,10 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5346
5346
|
slots[slot.name] = slot.key
|
|
5347
5347
|
? (...args) => {
|
|
5348
5348
|
const res = slot.fn(...args);
|
|
5349
|
-
|
|
5349
|
+
// attach branch key so each conditional branch is considered a
|
|
5350
|
+
// different fragment
|
|
5351
|
+
if (res)
|
|
5352
|
+
res.key = slot.key;
|
|
5350
5353
|
return res;
|
|
5351
5354
|
}
|
|
5352
5355
|
: slot.fn;
|
|
@@ -7126,7 +7129,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7126
7129
|
return vm;
|
|
7127
7130
|
}
|
|
7128
7131
|
}
|
|
7129
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7132
|
+
Vue.version = `2.6.14-compat:${"3.2.40"}`;
|
|
7130
7133
|
Vue.config = singletonApp.config;
|
|
7131
7134
|
Vue.use = (p, ...options) => {
|
|
7132
7135
|
if (p && isFunction(p.install)) {
|
|
@@ -7843,7 +7846,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7843
7846
|
const isFragmentStart = isComment(node) && node.data === '[';
|
|
7844
7847
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
7845
7848
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7846
|
-
|
|
7849
|
+
let domType = node.nodeType;
|
|
7847
7850
|
vnode.el = node;
|
|
7848
7851
|
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7849
7852
|
optimized = false;
|
|
@@ -7884,10 +7887,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7884
7887
|
}
|
|
7885
7888
|
break;
|
|
7886
7889
|
case Static:
|
|
7887
|
-
if (
|
|
7888
|
-
|
|
7890
|
+
if (isFragmentStart) {
|
|
7891
|
+
// entire template is static but SSRed as a fragment
|
|
7892
|
+
node = nextSibling(node);
|
|
7893
|
+
domType = node.nodeType;
|
|
7889
7894
|
}
|
|
7890
|
-
|
|
7895
|
+
if (domType === 1 /* DOMNodeTypes.ELEMENT */ || domType === 3 /* DOMNodeTypes.TEXT */) {
|
|
7891
7896
|
// determine anchor, adopt content
|
|
7892
7897
|
nextNode = node;
|
|
7893
7898
|
// if the static vnode has its content stripped during build,
|
|
@@ -7904,7 +7909,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7904
7909
|
}
|
|
7905
7910
|
nextNode = nextSibling(nextNode);
|
|
7906
7911
|
}
|
|
7907
|
-
return nextNode;
|
|
7912
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
7913
|
+
}
|
|
7914
|
+
else {
|
|
7915
|
+
onMismatch();
|
|
7908
7916
|
}
|
|
7909
7917
|
break;
|
|
7910
7918
|
case Fragment:
|
|
@@ -8262,7 +8270,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8262
8270
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
8263
8271
|
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
8264
8272
|
}
|
|
8265
|
-
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;
|
|
8266
8274
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
8267
8275
|
// style in order to prevent being inlined by minifiers.
|
|
8268
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) => {
|
|
@@ -8389,56 +8397,44 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8389
8397
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8390
8398
|
let el;
|
|
8391
8399
|
let vnodeHook;
|
|
8392
|
-
const { type, props, shapeFlag, transition,
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
// Only static vnodes can be reused, so its mounted DOM nodes should be
|
|
8399
|
-
// exactly the same, and we can simply do a clone here.
|
|
8400
|
-
// only do this in production since cloned trees cannot be HMR updated.
|
|
8401
|
-
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);
|
|
8402
8406
|
}
|
|
8403
|
-
else {
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
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
|
+
}
|
|
8412
8419
|
}
|
|
8413
|
-
|
|
8414
|
-
|
|
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);
|
|
8415
8431
|
}
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
for (const key in props) {
|
|
8419
|
-
if (key !== 'value' && !isReservedProp(key)) {
|
|
8420
|
-
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8421
|
-
}
|
|
8422
|
-
}
|
|
8423
|
-
/**
|
|
8424
|
-
* Special case for setting value on DOM elements:
|
|
8425
|
-
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8426
|
-
* - it needs to be forced (#1471)
|
|
8427
|
-
* #2353 proposes adding another renderer option to configure this, but
|
|
8428
|
-
* the properties affects are so finite it is worth special casing it
|
|
8429
|
-
* here to reduce the complexity. (Special casing it also should not
|
|
8430
|
-
* affect non-DOM renderers)
|
|
8431
|
-
*/
|
|
8432
|
-
if ('value' in props) {
|
|
8433
|
-
hostPatchProp(el, 'value', null, props.value);
|
|
8434
|
-
}
|
|
8435
|
-
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8436
|
-
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8437
|
-
}
|
|
8432
|
+
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8433
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8438
8434
|
}
|
|
8439
|
-
// scopeId
|
|
8440
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8441
8435
|
}
|
|
8436
|
+
// scopeId
|
|
8437
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8442
8438
|
if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
|
|
8443
8439
|
Object.defineProperty(el, '__vnode', {
|
|
8444
8440
|
value: vnode,
|
|
@@ -8625,6 +8621,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8625
8621
|
};
|
|
8626
8622
|
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
|
|
8627
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
|
+
}
|
|
8628
8631
|
for (const key in newProps) {
|
|
8629
8632
|
// empty string is not valid prop
|
|
8630
8633
|
if (isReservedProp(key))
|
|
@@ -8636,13 +8639,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8636
8639
|
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8637
8640
|
}
|
|
8638
8641
|
}
|
|
8639
|
-
if (oldProps !== EMPTY_OBJ) {
|
|
8640
|
-
for (const key in oldProps) {
|
|
8641
|
-
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8642
|
-
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8643
|
-
}
|
|
8644
|
-
}
|
|
8645
|
-
}
|
|
8646
8642
|
if ('value' in newProps) {
|
|
8647
8643
|
hostPatchProp(el, 'value', oldProps.value, newProps.value);
|
|
8648
8644
|
}
|
|
@@ -10269,7 +10265,10 @@ function normalizeVNode(child) {
|
|
|
10269
10265
|
}
|
|
10270
10266
|
// optimized normalization for template-compiled render fns
|
|
10271
10267
|
function cloneIfMounted(child) {
|
|
10272
|
-
return child.el === null
|
|
10268
|
+
return (child.el === null && child.patchFlag !== -1 /* PatchFlags.HOISTED */) ||
|
|
10269
|
+
child.memo
|
|
10270
|
+
? child
|
|
10271
|
+
: cloneVNode(child);
|
|
10273
10272
|
}
|
|
10274
10273
|
function normalizeChildren(vnode, children) {
|
|
10275
10274
|
let type = 0;
|
|
@@ -11207,7 +11206,7 @@ function isMemoSame(cached, memo) {
|
|
|
11207
11206
|
}
|
|
11208
11207
|
|
|
11209
11208
|
// Core API ------------------------------------------------------------------
|
|
11210
|
-
const version = "3.2.
|
|
11209
|
+
const version = "3.2.40";
|
|
11211
11210
|
const _ssrUtils = {
|
|
11212
11211
|
createComponentInstance,
|
|
11213
11212
|
setupComponent,
|
|
@@ -11273,22 +11272,6 @@ const nodeOps = {
|
|
|
11273
11272
|
setScopeId(el, id) {
|
|
11274
11273
|
el.setAttribute(id, '');
|
|
11275
11274
|
},
|
|
11276
|
-
cloneNode(el) {
|
|
11277
|
-
const cloned = el.cloneNode(true);
|
|
11278
|
-
// #3072
|
|
11279
|
-
// - in `patchDOMProp`, we store the actual value in the `el._value` property.
|
|
11280
|
-
// - normally, elements using `:value` bindings will not be hoisted, but if
|
|
11281
|
-
// the bound value is a constant, e.g. `:value="true"` - they do get
|
|
11282
|
-
// hoisted.
|
|
11283
|
-
// - in production, hoisted nodes are cloned when subsequent inserts, but
|
|
11284
|
-
// cloneNode() does not copy the custom property we attached.
|
|
11285
|
-
// - This may need to account for other custom DOM properties we attach to
|
|
11286
|
-
// elements in addition to `_value` in the future.
|
|
11287
|
-
if (`_value` in el) {
|
|
11288
|
-
cloned._value = el._value;
|
|
11289
|
-
}
|
|
11290
|
-
return cloned;
|
|
11291
|
-
},
|
|
11292
11275
|
// __UNSAFE__
|
|
11293
11276
|
// Reason: innerHTML.
|
|
11294
11277
|
// Static content here can only come from compiled templates.
|
|
@@ -11459,14 +11442,14 @@ const isEnumeratedAttr = /*#__PURE__*/ makeMap('contenteditable,draggable,spellc
|
|
|
11459
11442
|
;
|
|
11460
11443
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
11461
11444
|
if (isEnumeratedAttr(key)) {
|
|
11462
|
-
const
|
|
11445
|
+
const v2CoercedValue = value === null
|
|
11463
11446
|
? 'false'
|
|
11464
11447
|
: typeof value !== 'boolean' && value !== undefined
|
|
11465
11448
|
? 'true'
|
|
11466
11449
|
: null;
|
|
11467
|
-
if (
|
|
11468
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value,
|
|
11469
|
-
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);
|
|
11470
11453
|
return true;
|
|
11471
11454
|
}
|
|
11472
11455
|
}
|
|
@@ -11527,7 +11510,6 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11527
11510
|
}
|
|
11528
11511
|
else if (type === 'number') {
|
|
11529
11512
|
// e.g. <img :width="null">
|
|
11530
|
-
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
11531
11513
|
value = 0;
|
|
11532
11514
|
needRemove = true;
|
|
11533
11515
|
}
|
|
@@ -11551,7 +11533,8 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11551
11533
|
el[key] = value;
|
|
11552
11534
|
}
|
|
11553
11535
|
catch (e) {
|
|
11554
|
-
if
|
|
11536
|
+
// do not warn if value is auto-coerced from nullish values
|
|
11537
|
+
if ((process.env.NODE_ENV !== 'production') && !needRemove) {
|
|
11555
11538
|
warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11556
11539
|
`value ${value} is invalid.`, e);
|
|
11557
11540
|
}
|
|
@@ -4740,7 +4740,7 @@ var Vue = (function () {
|
|
|
4740
4740
|
const createHook = (lifecycle) => (hook, target = currentInstance) =>
|
|
4741
4741
|
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
|
|
4742
4742
|
(!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
|
|
4743
|
-
injectHook(lifecycle, hook, target);
|
|
4743
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
4744
4744
|
const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
|
|
4745
4745
|
const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
|
|
4746
4746
|
const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
|
|
@@ -5292,7 +5292,10 @@ var Vue = (function () {
|
|
|
5292
5292
|
slots[slot.name] = slot.key
|
|
5293
5293
|
? (...args) => {
|
|
5294
5294
|
const res = slot.fn(...args);
|
|
5295
|
-
|
|
5295
|
+
// attach branch key so each conditional branch is considered a
|
|
5296
|
+
// different fragment
|
|
5297
|
+
if (res)
|
|
5298
|
+
res.key = slot.key;
|
|
5296
5299
|
return res;
|
|
5297
5300
|
}
|
|
5298
5301
|
: slot.fn;
|
|
@@ -7060,7 +7063,7 @@ var Vue = (function () {
|
|
|
7060
7063
|
return vm;
|
|
7061
7064
|
}
|
|
7062
7065
|
}
|
|
7063
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7066
|
+
Vue.version = `2.6.14-compat:${"3.2.40"}`;
|
|
7064
7067
|
Vue.config = singletonApp.config;
|
|
7065
7068
|
Vue.use = (p, ...options) => {
|
|
7066
7069
|
if (p && isFunction(p.install)) {
|
|
@@ -7771,7 +7774,7 @@ var Vue = (function () {
|
|
|
7771
7774
|
const isFragmentStart = isComment(node) && node.data === '[';
|
|
7772
7775
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
7773
7776
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
7774
|
-
|
|
7777
|
+
let domType = node.nodeType;
|
|
7775
7778
|
vnode.el = node;
|
|
7776
7779
|
if (patchFlag === -2 /* PatchFlags.BAIL */) {
|
|
7777
7780
|
optimized = false;
|
|
@@ -7811,10 +7814,12 @@ var Vue = (function () {
|
|
|
7811
7814
|
}
|
|
7812
7815
|
break;
|
|
7813
7816
|
case Static:
|
|
7814
|
-
if (
|
|
7815
|
-
|
|
7817
|
+
if (isFragmentStart) {
|
|
7818
|
+
// entire template is static but SSRed as a fragment
|
|
7819
|
+
node = nextSibling(node);
|
|
7820
|
+
domType = node.nodeType;
|
|
7816
7821
|
}
|
|
7817
|
-
|
|
7822
|
+
if (domType === 1 /* DOMNodeTypes.ELEMENT */ || domType === 3 /* DOMNodeTypes.TEXT */) {
|
|
7818
7823
|
// determine anchor, adopt content
|
|
7819
7824
|
nextNode = node;
|
|
7820
7825
|
// if the static vnode has its content stripped during build,
|
|
@@ -7831,7 +7836,10 @@ var Vue = (function () {
|
|
|
7831
7836
|
}
|
|
7832
7837
|
nextNode = nextSibling(nextNode);
|
|
7833
7838
|
}
|
|
7834
|
-
return nextNode;
|
|
7839
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
7840
|
+
}
|
|
7841
|
+
else {
|
|
7842
|
+
onMismatch();
|
|
7835
7843
|
}
|
|
7836
7844
|
break;
|
|
7837
7845
|
case Fragment:
|
|
@@ -8156,7 +8164,7 @@ var Vue = (function () {
|
|
|
8156
8164
|
{
|
|
8157
8165
|
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
|
|
8158
8166
|
}
|
|
8159
|
-
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;
|
|
8160
8168
|
// Note: functions inside this closure should use `const xxx = () => {}`
|
|
8161
8169
|
// style in order to prevent being inlined by minifiers.
|
|
8162
8170
|
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
@@ -8283,46 +8291,44 @@ var Vue = (function () {
|
|
|
8283
8291
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
|
|
8284
8292
|
let el;
|
|
8285
8293
|
let vnodeHook;
|
|
8286
|
-
const { type, props, shapeFlag, transition,
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
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
|
+
}
|
|
8296
8313
|
}
|
|
8297
|
-
|
|
8298
|
-
|
|
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);
|
|
8299
8325
|
}
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
for (const key in props) {
|
|
8303
|
-
if (key !== 'value' && !isReservedProp(key)) {
|
|
8304
|
-
hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8305
|
-
}
|
|
8306
|
-
}
|
|
8307
|
-
/**
|
|
8308
|
-
* Special case for setting value on DOM elements:
|
|
8309
|
-
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
|
|
8310
|
-
* - it needs to be forced (#1471)
|
|
8311
|
-
* #2353 proposes adding another renderer option to configure this, but
|
|
8312
|
-
* the properties affects are so finite it is worth special casing it
|
|
8313
|
-
* here to reduce the complexity. (Special casing it also should not
|
|
8314
|
-
* affect non-DOM renderers)
|
|
8315
|
-
*/
|
|
8316
|
-
if ('value' in props) {
|
|
8317
|
-
hostPatchProp(el, 'value', null, props.value);
|
|
8318
|
-
}
|
|
8319
|
-
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8320
|
-
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8321
|
-
}
|
|
8326
|
+
if ((vnodeHook = props.onVnodeBeforeMount)) {
|
|
8327
|
+
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8322
8328
|
}
|
|
8323
|
-
// scopeId
|
|
8324
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8325
8329
|
}
|
|
8330
|
+
// scopeId
|
|
8331
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
8326
8332
|
{
|
|
8327
8333
|
Object.defineProperty(el, '__vnode', {
|
|
8328
8334
|
value: vnode,
|
|
@@ -8508,6 +8514,13 @@ var Vue = (function () {
|
|
|
8508
8514
|
};
|
|
8509
8515
|
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
|
|
8510
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
|
+
}
|
|
8511
8524
|
for (const key in newProps) {
|
|
8512
8525
|
// empty string is not valid prop
|
|
8513
8526
|
if (isReservedProp(key))
|
|
@@ -8519,13 +8532,6 @@ var Vue = (function () {
|
|
|
8519
8532
|
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8520
8533
|
}
|
|
8521
8534
|
}
|
|
8522
|
-
if (oldProps !== EMPTY_OBJ) {
|
|
8523
|
-
for (const key in oldProps) {
|
|
8524
|
-
if (!isReservedProp(key) && !(key in newProps)) {
|
|
8525
|
-
hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
|
|
8526
|
-
}
|
|
8527
|
-
}
|
|
8528
|
-
}
|
|
8529
8535
|
if ('value' in newProps) {
|
|
8530
8536
|
hostPatchProp(el, 'value', oldProps.value, newProps.value);
|
|
8531
8537
|
}
|
|
@@ -10145,7 +10151,10 @@ var Vue = (function () {
|
|
|
10145
10151
|
}
|
|
10146
10152
|
// optimized normalization for template-compiled render fns
|
|
10147
10153
|
function cloneIfMounted(child) {
|
|
10148
|
-
return child.el === null
|
|
10154
|
+
return (child.el === null && child.patchFlag !== -1 /* PatchFlags.HOISTED */) ||
|
|
10155
|
+
child.memo
|
|
10156
|
+
? child
|
|
10157
|
+
: cloneVNode(child);
|
|
10149
10158
|
}
|
|
10150
10159
|
function normalizeChildren(vnode, children) {
|
|
10151
10160
|
let type = 0;
|
|
@@ -11054,7 +11063,7 @@ var Vue = (function () {
|
|
|
11054
11063
|
}
|
|
11055
11064
|
|
|
11056
11065
|
// Core API ------------------------------------------------------------------
|
|
11057
|
-
const version = "3.2.
|
|
11066
|
+
const version = "3.2.40";
|
|
11058
11067
|
/**
|
|
11059
11068
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
11060
11069
|
* @internal
|
|
@@ -11112,22 +11121,6 @@ var Vue = (function () {
|
|
|
11112
11121
|
setScopeId(el, id) {
|
|
11113
11122
|
el.setAttribute(id, '');
|
|
11114
11123
|
},
|
|
11115
|
-
cloneNode(el) {
|
|
11116
|
-
const cloned = el.cloneNode(true);
|
|
11117
|
-
// #3072
|
|
11118
|
-
// - in `patchDOMProp`, we store the actual value in the `el._value` property.
|
|
11119
|
-
// - normally, elements using `:value` bindings will not be hoisted, but if
|
|
11120
|
-
// the bound value is a constant, e.g. `:value="true"` - they do get
|
|
11121
|
-
// hoisted.
|
|
11122
|
-
// - in production, hoisted nodes are cloned when subsequent inserts, but
|
|
11123
|
-
// cloneNode() does not copy the custom property we attached.
|
|
11124
|
-
// - This may need to account for other custom DOM properties we attach to
|
|
11125
|
-
// elements in addition to `_value` in the future.
|
|
11126
|
-
if (`_value` in el) {
|
|
11127
|
-
cloned._value = el._value;
|
|
11128
|
-
}
|
|
11129
|
-
return cloned;
|
|
11130
|
-
},
|
|
11131
11124
|
// __UNSAFE__
|
|
11132
11125
|
// Reason: innerHTML.
|
|
11133
11126
|
// Static content here can only come from compiled templates.
|
|
@@ -11298,14 +11291,14 @@ var Vue = (function () {
|
|
|
11298
11291
|
;
|
|
11299
11292
|
function compatCoerceAttr(el, key, value, instance = null) {
|
|
11300
11293
|
if (isEnumeratedAttr(key)) {
|
|
11301
|
-
const
|
|
11294
|
+
const v2CoercedValue = value === null
|
|
11302
11295
|
? 'false'
|
|
11303
11296
|
: typeof value !== 'boolean' && value !== undefined
|
|
11304
11297
|
? 'true'
|
|
11305
11298
|
: null;
|
|
11306
|
-
if (
|
|
11307
|
-
compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value,
|
|
11308
|
-
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);
|
|
11309
11302
|
return true;
|
|
11310
11303
|
}
|
|
11311
11304
|
}
|
|
@@ -11366,7 +11359,6 @@ var Vue = (function () {
|
|
|
11366
11359
|
}
|
|
11367
11360
|
else if (type === 'number') {
|
|
11368
11361
|
// e.g. <img :width="null">
|
|
11369
|
-
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
11370
11362
|
value = 0;
|
|
11371
11363
|
needRemove = true;
|
|
11372
11364
|
}
|
|
@@ -11389,7 +11381,8 @@ var Vue = (function () {
|
|
|
11389
11381
|
el[key] = value;
|
|
11390
11382
|
}
|
|
11391
11383
|
catch (e) {
|
|
11392
|
-
|
|
11384
|
+
// do not warn if value is auto-coerced from nullish values
|
|
11385
|
+
if (!needRemove) {
|
|
11393
11386
|
warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
11394
11387
|
`value ${value} is invalid.`, e);
|
|
11395
11388
|
}
|