@vue/compat 3.2.34-beta.1 → 3.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +68 -31
- package/dist/vue.cjs.prod.js +65 -29
- package/dist/vue.esm-browser.js +53 -35
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +69 -31
- package/dist/vue.global.js +53 -35
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +48 -29
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +64 -25
- package/dist/vue.runtime.global.js +48 -29
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.js
CHANGED
|
@@ -4677,7 +4677,10 @@ const KeepAliveImpl = {
|
|
|
4677
4677
|
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
4678
4678
|
// for KeepAlive, we just need to render its children
|
|
4679
4679
|
if (!sharedContext.renderer) {
|
|
4680
|
-
return
|
|
4680
|
+
return () => {
|
|
4681
|
+
const children = slots.default && slots.default();
|
|
4682
|
+
return children && children.length === 1 ? children[0] : children;
|
|
4683
|
+
};
|
|
4681
4684
|
}
|
|
4682
4685
|
const cache = new Map();
|
|
4683
4686
|
const keys = new Set();
|
|
@@ -7277,7 +7280,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7277
7280
|
return vm;
|
|
7278
7281
|
}
|
|
7279
7282
|
}
|
|
7280
|
-
Vue.version = `2.6.14-compat:${"3.2.34
|
|
7283
|
+
Vue.version = `2.6.14-compat:${"3.2.34"}`;
|
|
7281
7284
|
Vue.config = singletonApp.config;
|
|
7282
7285
|
Vue.use = (p, ...options) => {
|
|
7283
7286
|
if (p && isFunction(p.install)) {
|
|
@@ -7963,7 +7966,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
7963
7966
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
7964
7967
|
// passed in via arguments.
|
|
7965
7968
|
function createHydrationFunctions(rendererInternals) {
|
|
7966
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7969
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7967
7970
|
const hydrate = (vnode, container) => {
|
|
7968
7971
|
if (!container.hasChildNodes()) {
|
|
7969
7972
|
warn$1(`Attempting to hydrate existing markup but container is empty. ` +
|
|
@@ -7994,7 +7997,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7994
7997
|
switch (type) {
|
|
7995
7998
|
case Text:
|
|
7996
7999
|
if (domType !== 3 /* TEXT */) {
|
|
7997
|
-
|
|
8000
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
8001
|
+
// because the server rendered HTML won't contain a text node
|
|
8002
|
+
if (vnode.children === '') {
|
|
8003
|
+
insert((vnode.el = createText('')), node.parentElement, node);
|
|
8004
|
+
nextNode = node;
|
|
8005
|
+
}
|
|
8006
|
+
else {
|
|
8007
|
+
nextNode = onMismatch();
|
|
8008
|
+
}
|
|
7998
8009
|
}
|
|
7999
8010
|
else {
|
|
8000
8011
|
if (node.data !== vnode.children) {
|
|
@@ -8068,6 +8079,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8068
8079
|
nextNode = isFragmentStart
|
|
8069
8080
|
? locateClosingAsyncAnchor(node)
|
|
8070
8081
|
: nextSibling(node);
|
|
8082
|
+
// #4293 teleport as component root
|
|
8083
|
+
if (nextNode &&
|
|
8084
|
+
isComment(nextNode) &&
|
|
8085
|
+
nextNode.data === 'teleport end') {
|
|
8086
|
+
nextNode = nextSibling(nextNode);
|
|
8087
|
+
}
|
|
8071
8088
|
// #3787
|
|
8072
8089
|
// if component is async, it may get moved / unmounted before its
|
|
8073
8090
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -8731,8 +8748,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8731
8748
|
const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
|
|
8732
8749
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
8733
8750
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8734
|
-
if (
|
|
8735
|
-
|
|
8751
|
+
if (// #5523 dev root fragment may inherit directives
|
|
8752
|
+
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8753
|
+
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8736
8754
|
patchFlag = 0;
|
|
8737
8755
|
optimized = false;
|
|
8738
8756
|
dynamicChildren = null;
|
|
@@ -8754,8 +8772,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8754
8772
|
else {
|
|
8755
8773
|
if (patchFlag > 0 &&
|
|
8756
8774
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8757
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
8758
|
-
!(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
|
|
8759
8775
|
dynamicChildren &&
|
|
8760
8776
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8761
8777
|
// of renderSlot() with no valid children
|
|
@@ -9866,10 +9882,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9866
9882
|
}
|
|
9867
9883
|
else {
|
|
9868
9884
|
vnode.anchor = nextSibling(node);
|
|
9869
|
-
|
|
9885
|
+
// lookahead until we find the target anchor
|
|
9886
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
9887
|
+
// could be nested teleports
|
|
9888
|
+
let targetAnchor = targetNode;
|
|
9889
|
+
while (targetAnchor) {
|
|
9890
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
9891
|
+
if (targetAnchor &&
|
|
9892
|
+
targetAnchor.nodeType === 8 &&
|
|
9893
|
+
targetAnchor.data === 'teleport anchor') {
|
|
9894
|
+
vnode.targetAnchor = targetAnchor;
|
|
9895
|
+
target._lpa =
|
|
9896
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9897
|
+
break;
|
|
9898
|
+
}
|
|
9899
|
+
}
|
|
9900
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9870
9901
|
}
|
|
9871
|
-
target._lpa =
|
|
9872
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9873
9902
|
}
|
|
9874
9903
|
}
|
|
9875
9904
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -11243,7 +11272,7 @@ function isMemoSame(cached, memo) {
|
|
|
11243
11272
|
}
|
|
11244
11273
|
|
|
11245
11274
|
// Core API ------------------------------------------------------------------
|
|
11246
|
-
const version = "3.2.34
|
|
11275
|
+
const version = "3.2.34";
|
|
11247
11276
|
const _ssrUtils = {
|
|
11248
11277
|
createComponentInstance,
|
|
11249
11278
|
setupComponent,
|
|
@@ -12693,27 +12722,25 @@ const vModelDynamic = {
|
|
|
12693
12722
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
12694
12723
|
}
|
|
12695
12724
|
};
|
|
12696
|
-
function
|
|
12697
|
-
|
|
12698
|
-
switch (el.tagName) {
|
|
12725
|
+
function resolveDynamicModel(tagName, type) {
|
|
12726
|
+
switch (tagName) {
|
|
12699
12727
|
case 'SELECT':
|
|
12700
|
-
|
|
12701
|
-
break;
|
|
12728
|
+
return vModelSelect;
|
|
12702
12729
|
case 'TEXTAREA':
|
|
12703
|
-
|
|
12704
|
-
break;
|
|
12730
|
+
return vModelText;
|
|
12705
12731
|
default:
|
|
12706
|
-
switch (
|
|
12732
|
+
switch (type) {
|
|
12707
12733
|
case 'checkbox':
|
|
12708
|
-
|
|
12709
|
-
break;
|
|
12734
|
+
return vModelCheckbox;
|
|
12710
12735
|
case 'radio':
|
|
12711
|
-
|
|
12712
|
-
break;
|
|
12736
|
+
return vModelRadio;
|
|
12713
12737
|
default:
|
|
12714
|
-
|
|
12738
|
+
return vModelText;
|
|
12715
12739
|
}
|
|
12716
12740
|
}
|
|
12741
|
+
}
|
|
12742
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
12743
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
12717
12744
|
const fn = modelToUse[hook];
|
|
12718
12745
|
fn && fn(el, binding, vnode, prevVNode);
|
|
12719
12746
|
}
|
|
@@ -12741,6 +12768,17 @@ function initVModelForSSR() {
|
|
|
12741
12768
|
return { checked: true };
|
|
12742
12769
|
}
|
|
12743
12770
|
};
|
|
12771
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
12772
|
+
if (typeof vnode.type !== 'string') {
|
|
12773
|
+
return;
|
|
12774
|
+
}
|
|
12775
|
+
const modelToUse = resolveDynamicModel(
|
|
12776
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
12777
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
12778
|
+
if (modelToUse.getSSRProps) {
|
|
12779
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
12780
|
+
}
|
|
12781
|
+
};
|
|
12744
12782
|
}
|
|
12745
12783
|
|
|
12746
12784
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -17409,7 +17447,7 @@ const transformElement = (node, context) => {
|
|
|
17409
17447
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
17410
17448
|
// props
|
|
17411
17449
|
if (props.length > 0) {
|
|
17412
|
-
const propsBuildResult = buildProps(node, context);
|
|
17450
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
17413
17451
|
vnodeProps = propsBuildResult.props;
|
|
17414
17452
|
patchFlag = propsBuildResult.patchFlag;
|
|
17415
17453
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -17610,9 +17648,8 @@ function resolveSetupReference(name, context) {
|
|
|
17610
17648
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
17611
17649
|
}
|
|
17612
17650
|
}
|
|
17613
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
17651
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
17614
17652
|
const { tag, loc: elementLoc, children } = node;
|
|
17615
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
17616
17653
|
let properties = [];
|
|
17617
17654
|
const mergeArgs = [];
|
|
17618
17655
|
const runtimeDirectives = [];
|
|
@@ -17631,8 +17668,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
17631
17668
|
if (isStaticExp(key)) {
|
|
17632
17669
|
const name = key.content;
|
|
17633
17670
|
const isEventHandler = isOn(name);
|
|
17634
|
-
if (
|
|
17635
|
-
|
|
17671
|
+
if (isEventHandler &&
|
|
17672
|
+
(!isComponent || isDynamicComponent) &&
|
|
17636
17673
|
// omit the flag for click handlers because hydration gives click
|
|
17637
17674
|
// dedicated fast path.
|
|
17638
17675
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -18085,7 +18122,7 @@ function processSlotOutlet(node, context) {
|
|
|
18085
18122
|
}
|
|
18086
18123
|
}
|
|
18087
18124
|
if (nonNameProps.length > 0) {
|
|
18088
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
18125
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
18089
18126
|
slotProps = props;
|
|
18090
18127
|
if (directives.length) {
|
|
18091
18128
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -3688,7 +3688,10 @@ const KeepAliveImpl = {
|
|
|
3688
3688
|
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
3689
3689
|
// for KeepAlive, we just need to render its children
|
|
3690
3690
|
if (!sharedContext.renderer) {
|
|
3691
|
-
return
|
|
3691
|
+
return () => {
|
|
3692
|
+
const children = slots.default && slots.default();
|
|
3693
|
+
return children && children.length === 1 ? children[0] : children;
|
|
3694
|
+
};
|
|
3692
3695
|
}
|
|
3693
3696
|
const cache = new Map();
|
|
3694
3697
|
const keys = new Set();
|
|
@@ -5848,7 +5851,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5848
5851
|
return vm;
|
|
5849
5852
|
}
|
|
5850
5853
|
}
|
|
5851
|
-
Vue.version = `2.6.14-compat:${"3.2.34
|
|
5854
|
+
Vue.version = `2.6.14-compat:${"3.2.34"}`;
|
|
5852
5855
|
Vue.config = singletonApp.config;
|
|
5853
5856
|
Vue.use = (p, ...options) => {
|
|
5854
5857
|
if (p && isFunction(p.install)) {
|
|
@@ -6426,7 +6429,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
6426
6429
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
6427
6430
|
// passed in via arguments.
|
|
6428
6431
|
function createHydrationFunctions(rendererInternals) {
|
|
6429
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6432
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6430
6433
|
const hydrate = (vnode, container) => {
|
|
6431
6434
|
if (!container.hasChildNodes()) {
|
|
6432
6435
|
patch(null, vnode, container);
|
|
@@ -6455,7 +6458,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6455
6458
|
switch (type) {
|
|
6456
6459
|
case Text:
|
|
6457
6460
|
if (domType !== 3 /* TEXT */) {
|
|
6458
|
-
|
|
6461
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
6462
|
+
// because the server rendered HTML won't contain a text node
|
|
6463
|
+
if (vnode.children === '') {
|
|
6464
|
+
insert((vnode.el = createText('')), node.parentElement, node);
|
|
6465
|
+
nextNode = node;
|
|
6466
|
+
}
|
|
6467
|
+
else {
|
|
6468
|
+
nextNode = onMismatch();
|
|
6469
|
+
}
|
|
6459
6470
|
}
|
|
6460
6471
|
else {
|
|
6461
6472
|
if (node.data !== vnode.children) {
|
|
@@ -6526,6 +6537,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6526
6537
|
nextNode = isFragmentStart
|
|
6527
6538
|
? locateClosingAsyncAnchor(node)
|
|
6528
6539
|
: nextSibling(node);
|
|
6540
|
+
// #4293 teleport as component root
|
|
6541
|
+
if (nextNode &&
|
|
6542
|
+
isComment(nextNode) &&
|
|
6543
|
+
nextNode.data === 'teleport end') {
|
|
6544
|
+
nextNode = nextSibling(nextNode);
|
|
6545
|
+
}
|
|
6529
6546
|
// #3787
|
|
6530
6547
|
// if component is async, it may get moved / unmounted before its
|
|
6531
6548
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -7107,8 +7124,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7107
7124
|
else {
|
|
7108
7125
|
if (patchFlag > 0 &&
|
|
7109
7126
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
7110
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
7111
|
-
!(false /* DEV_ROOT_FRAGMENT */) &&
|
|
7112
7127
|
dynamicChildren &&
|
|
7113
7128
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
7114
7129
|
// of renderSlot() with no valid children
|
|
@@ -8081,10 +8096,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
8081
8096
|
}
|
|
8082
8097
|
else {
|
|
8083
8098
|
vnode.anchor = nextSibling(node);
|
|
8084
|
-
|
|
8099
|
+
// lookahead until we find the target anchor
|
|
8100
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
8101
|
+
// could be nested teleports
|
|
8102
|
+
let targetAnchor = targetNode;
|
|
8103
|
+
while (targetAnchor) {
|
|
8104
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
8105
|
+
if (targetAnchor &&
|
|
8106
|
+
targetAnchor.nodeType === 8 &&
|
|
8107
|
+
targetAnchor.data === 'teleport anchor') {
|
|
8108
|
+
vnode.targetAnchor = targetAnchor;
|
|
8109
|
+
target._lpa =
|
|
8110
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
8111
|
+
break;
|
|
8112
|
+
}
|
|
8113
|
+
}
|
|
8114
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
8085
8115
|
}
|
|
8086
|
-
target._lpa =
|
|
8087
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
8088
8116
|
}
|
|
8089
8117
|
}
|
|
8090
8118
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -9118,7 +9146,7 @@ function isMemoSame(cached, memo) {
|
|
|
9118
9146
|
}
|
|
9119
9147
|
|
|
9120
9148
|
// Core API ------------------------------------------------------------------
|
|
9121
|
-
const version = "3.2.34
|
|
9149
|
+
const version = "3.2.34";
|
|
9122
9150
|
const _ssrUtils = {
|
|
9123
9151
|
createComponentInstance,
|
|
9124
9152
|
setupComponent,
|
|
@@ -10518,27 +10546,25 @@ const vModelDynamic = {
|
|
|
10518
10546
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
10519
10547
|
}
|
|
10520
10548
|
};
|
|
10521
|
-
function
|
|
10522
|
-
|
|
10523
|
-
switch (el.tagName) {
|
|
10549
|
+
function resolveDynamicModel(tagName, type) {
|
|
10550
|
+
switch (tagName) {
|
|
10524
10551
|
case 'SELECT':
|
|
10525
|
-
|
|
10526
|
-
break;
|
|
10552
|
+
return vModelSelect;
|
|
10527
10553
|
case 'TEXTAREA':
|
|
10528
|
-
|
|
10529
|
-
break;
|
|
10554
|
+
return vModelText;
|
|
10530
10555
|
default:
|
|
10531
|
-
switch (
|
|
10556
|
+
switch (type) {
|
|
10532
10557
|
case 'checkbox':
|
|
10533
|
-
|
|
10534
|
-
break;
|
|
10558
|
+
return vModelCheckbox;
|
|
10535
10559
|
case 'radio':
|
|
10536
|
-
|
|
10537
|
-
break;
|
|
10560
|
+
return vModelRadio;
|
|
10538
10561
|
default:
|
|
10539
|
-
|
|
10562
|
+
return vModelText;
|
|
10540
10563
|
}
|
|
10541
10564
|
}
|
|
10565
|
+
}
|
|
10566
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
10567
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
10542
10568
|
const fn = modelToUse[hook];
|
|
10543
10569
|
fn && fn(el, binding, vnode, prevVNode);
|
|
10544
10570
|
}
|
|
@@ -10566,6 +10592,17 @@ function initVModelForSSR() {
|
|
|
10566
10592
|
return { checked: true };
|
|
10567
10593
|
}
|
|
10568
10594
|
};
|
|
10595
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
10596
|
+
if (typeof vnode.type !== 'string') {
|
|
10597
|
+
return;
|
|
10598
|
+
}
|
|
10599
|
+
const modelToUse = resolveDynamicModel(
|
|
10600
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
10601
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
10602
|
+
if (modelToUse.getSSRProps) {
|
|
10603
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
10604
|
+
}
|
|
10605
|
+
};
|
|
10569
10606
|
}
|
|
10570
10607
|
|
|
10571
10608
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -15008,7 +15045,7 @@ const transformElement = (node, context) => {
|
|
|
15008
15045
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
15009
15046
|
// props
|
|
15010
15047
|
if (props.length > 0) {
|
|
15011
|
-
const propsBuildResult = buildProps(node, context);
|
|
15048
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
15012
15049
|
vnodeProps = propsBuildResult.props;
|
|
15013
15050
|
patchFlag = propsBuildResult.patchFlag;
|
|
15014
15051
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -15190,9 +15227,8 @@ function resolveSetupReference(name, context) {
|
|
|
15190
15227
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
15191
15228
|
}
|
|
15192
15229
|
}
|
|
15193
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
15230
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
15194
15231
|
const { tag, loc: elementLoc, children } = node;
|
|
15195
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
15196
15232
|
let properties = [];
|
|
15197
15233
|
const mergeArgs = [];
|
|
15198
15234
|
const runtimeDirectives = [];
|
|
@@ -15211,8 +15247,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
15211
15247
|
if (isStaticExp(key)) {
|
|
15212
15248
|
const name = key.content;
|
|
15213
15249
|
const isEventHandler = isOn(name);
|
|
15214
|
-
if (
|
|
15215
|
-
|
|
15250
|
+
if (isEventHandler &&
|
|
15251
|
+
(!isComponent || isDynamicComponent) &&
|
|
15216
15252
|
// omit the flag for click handlers because hydration gives click
|
|
15217
15253
|
// dedicated fast path.
|
|
15218
15254
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -15642,7 +15678,7 @@ function processSlotOutlet(node, context) {
|
|
|
15642
15678
|
}
|
|
15643
15679
|
}
|
|
15644
15680
|
if (nonNameProps.length > 0) {
|
|
15645
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
15681
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
15646
15682
|
slotProps = props;
|
|
15647
15683
|
if (directives.length) {
|
|
15648
15684
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
package/dist/vue.esm-browser.js
CHANGED
|
@@ -4510,11 +4510,6 @@ const KeepAliveImpl = {
|
|
|
4510
4510
|
// The whole point of this is to avoid importing KeepAlive directly in the
|
|
4511
4511
|
// renderer to facilitate tree-shaking.
|
|
4512
4512
|
const sharedContext = instance.ctx;
|
|
4513
|
-
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
4514
|
-
// for KeepAlive, we just need to render its children
|
|
4515
|
-
if (!sharedContext.renderer) {
|
|
4516
|
-
return slots.default;
|
|
4517
|
-
}
|
|
4518
4513
|
const cache = new Map();
|
|
4519
4514
|
const keys = new Set();
|
|
4520
4515
|
let current = null;
|
|
@@ -7113,7 +7108,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7113
7108
|
return vm;
|
|
7114
7109
|
}
|
|
7115
7110
|
}
|
|
7116
|
-
Vue.version = `2.6.14-compat:${"3.2.34
|
|
7111
|
+
Vue.version = `2.6.14-compat:${"3.2.34"}`;
|
|
7117
7112
|
Vue.config = singletonApp.config;
|
|
7118
7113
|
Vue.use = (p, ...options) => {
|
|
7119
7114
|
if (p && isFunction(p.install)) {
|
|
@@ -7799,7 +7794,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
7799
7794
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
7800
7795
|
// passed in via arguments.
|
|
7801
7796
|
function createHydrationFunctions(rendererInternals) {
|
|
7802
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7797
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7803
7798
|
const hydrate = (vnode, container) => {
|
|
7804
7799
|
if (!container.hasChildNodes()) {
|
|
7805
7800
|
warn$1(`Attempting to hydrate existing markup but container is empty. ` +
|
|
@@ -7830,7 +7825,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7830
7825
|
switch (type) {
|
|
7831
7826
|
case Text:
|
|
7832
7827
|
if (domType !== 3 /* TEXT */) {
|
|
7833
|
-
|
|
7828
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
7829
|
+
// because the server rendered HTML won't contain a text node
|
|
7830
|
+
if (vnode.children === '') {
|
|
7831
|
+
insert((vnode.el = createText('')), node.parentElement, node);
|
|
7832
|
+
nextNode = node;
|
|
7833
|
+
}
|
|
7834
|
+
else {
|
|
7835
|
+
nextNode = onMismatch();
|
|
7836
|
+
}
|
|
7834
7837
|
}
|
|
7835
7838
|
else {
|
|
7836
7839
|
if (node.data !== vnode.children) {
|
|
@@ -7904,6 +7907,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7904
7907
|
nextNode = isFragmentStart
|
|
7905
7908
|
? locateClosingAsyncAnchor(node)
|
|
7906
7909
|
: nextSibling(node);
|
|
7910
|
+
// #4293 teleport as component root
|
|
7911
|
+
if (nextNode &&
|
|
7912
|
+
isComment(nextNode) &&
|
|
7913
|
+
nextNode.data === 'teleport end') {
|
|
7914
|
+
nextNode = nextSibling(nextNode);
|
|
7915
|
+
}
|
|
7907
7916
|
// #3787
|
|
7908
7917
|
// if component is async, it may get moved / unmounted before its
|
|
7909
7918
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -8567,8 +8576,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8567
8576
|
const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
|
|
8568
8577
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
8569
8578
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8570
|
-
if (
|
|
8571
|
-
|
|
8579
|
+
if (// #5523 dev root fragment may inherit directives
|
|
8580
|
+
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8581
|
+
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8572
8582
|
patchFlag = 0;
|
|
8573
8583
|
optimized = false;
|
|
8574
8584
|
dynamicChildren = null;
|
|
@@ -8590,8 +8600,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8590
8600
|
else {
|
|
8591
8601
|
if (patchFlag > 0 &&
|
|
8592
8602
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8593
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
8594
|
-
!(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
|
|
8595
8603
|
dynamicChildren &&
|
|
8596
8604
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8597
8605
|
// of renderSlot() with no valid children
|
|
@@ -9702,10 +9710,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9702
9710
|
}
|
|
9703
9711
|
else {
|
|
9704
9712
|
vnode.anchor = nextSibling(node);
|
|
9705
|
-
|
|
9713
|
+
// lookahead until we find the target anchor
|
|
9714
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
9715
|
+
// could be nested teleports
|
|
9716
|
+
let targetAnchor = targetNode;
|
|
9717
|
+
while (targetAnchor) {
|
|
9718
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
9719
|
+
if (targetAnchor &&
|
|
9720
|
+
targetAnchor.nodeType === 8 &&
|
|
9721
|
+
targetAnchor.data === 'teleport anchor') {
|
|
9722
|
+
vnode.targetAnchor = targetAnchor;
|
|
9723
|
+
target._lpa =
|
|
9724
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9725
|
+
break;
|
|
9726
|
+
}
|
|
9727
|
+
}
|
|
9728
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9706
9729
|
}
|
|
9707
|
-
target._lpa =
|
|
9708
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9709
9730
|
}
|
|
9710
9731
|
}
|
|
9711
9732
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -11076,7 +11097,7 @@ function isMemoSame(cached, memo) {
|
|
|
11076
11097
|
}
|
|
11077
11098
|
|
|
11078
11099
|
// Core API ------------------------------------------------------------------
|
|
11079
|
-
const version = "3.2.34
|
|
11100
|
+
const version = "3.2.34";
|
|
11080
11101
|
/**
|
|
11081
11102
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
11082
11103
|
* @internal
|
|
@@ -12568,27 +12589,25 @@ const vModelDynamic = {
|
|
|
12568
12589
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
12569
12590
|
}
|
|
12570
12591
|
};
|
|
12571
|
-
function
|
|
12572
|
-
|
|
12573
|
-
switch (el.tagName) {
|
|
12592
|
+
function resolveDynamicModel(tagName, type) {
|
|
12593
|
+
switch (tagName) {
|
|
12574
12594
|
case 'SELECT':
|
|
12575
|
-
|
|
12576
|
-
break;
|
|
12595
|
+
return vModelSelect;
|
|
12577
12596
|
case 'TEXTAREA':
|
|
12578
|
-
|
|
12579
|
-
break;
|
|
12597
|
+
return vModelText;
|
|
12580
12598
|
default:
|
|
12581
|
-
switch (
|
|
12599
|
+
switch (type) {
|
|
12582
12600
|
case 'checkbox':
|
|
12583
|
-
|
|
12584
|
-
break;
|
|
12601
|
+
return vModelCheckbox;
|
|
12585
12602
|
case 'radio':
|
|
12586
|
-
|
|
12587
|
-
break;
|
|
12603
|
+
return vModelRadio;
|
|
12588
12604
|
default:
|
|
12589
|
-
|
|
12605
|
+
return vModelText;
|
|
12590
12606
|
}
|
|
12591
12607
|
}
|
|
12608
|
+
}
|
|
12609
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
12610
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
12592
12611
|
const fn = modelToUse[hook];
|
|
12593
12612
|
fn && fn(el, binding, vnode, prevVNode);
|
|
12594
12613
|
}
|
|
@@ -16485,7 +16504,7 @@ const transformElement = (node, context) => {
|
|
|
16485
16504
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
16486
16505
|
// props
|
|
16487
16506
|
if (props.length > 0) {
|
|
16488
|
-
const propsBuildResult = buildProps(node, context);
|
|
16507
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
16489
16508
|
vnodeProps = propsBuildResult.props;
|
|
16490
16509
|
patchFlag = propsBuildResult.patchFlag;
|
|
16491
16510
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -16624,9 +16643,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16624
16643
|
context.components.add(tag);
|
|
16625
16644
|
return toValidAssetId(tag, `component`);
|
|
16626
16645
|
}
|
|
16627
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
16646
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
16628
16647
|
const { tag, loc: elementLoc, children } = node;
|
|
16629
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
16630
16648
|
let properties = [];
|
|
16631
16649
|
const mergeArgs = [];
|
|
16632
16650
|
const runtimeDirectives = [];
|
|
@@ -16645,8 +16663,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
16645
16663
|
if (isStaticExp(key)) {
|
|
16646
16664
|
const name = key.content;
|
|
16647
16665
|
const isEventHandler = isOn(name);
|
|
16648
|
-
if (
|
|
16649
|
-
|
|
16666
|
+
if (isEventHandler &&
|
|
16667
|
+
(!isComponent || isDynamicComponent) &&
|
|
16650
16668
|
// omit the flag for click handlers because hydration gives click
|
|
16651
16669
|
// dedicated fast path.
|
|
16652
16670
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -17084,7 +17102,7 @@ function processSlotOutlet(node, context) {
|
|
|
17084
17102
|
}
|
|
17085
17103
|
}
|
|
17086
17104
|
if (nonNameProps.length > 0) {
|
|
17087
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
17105
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
17088
17106
|
slotProps = props;
|
|
17089
17107
|
if (directives.length) {
|
|
17090
17108
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|