@vue/compat 3.2.43 → 3.2.45
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 +167 -115
- package/dist/vue.cjs.prod.js +143 -86
- package/dist/vue.esm-browser.js +176 -118
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +177 -120
- package/dist/vue.global.js +176 -118
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +132 -81
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +133 -83
- package/dist/vue.runtime.global.js +132 -81
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -3003,10 +3003,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3003
3003
|
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
|
|
3004
3004
|
newValue,
|
|
3005
3005
|
// pass undefined as the old value when it's changed for the first time
|
|
3006
|
-
oldValue === INITIAL_WATCHER_VALUE
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3006
|
+
oldValue === INITIAL_WATCHER_VALUE
|
|
3007
|
+
? undefined
|
|
3008
|
+
: (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
|
|
3009
|
+
? []
|
|
3010
|
+
: oldValue,
|
|
3010
3011
|
onCleanup
|
|
3011
3012
|
]);
|
|
3012
3013
|
oldValue = newValue;
|
|
@@ -3583,10 +3584,15 @@ function defineAsyncComponent(source) {
|
|
|
3583
3584
|
}
|
|
3584
3585
|
});
|
|
3585
3586
|
}
|
|
3586
|
-
function createInnerComp(comp,
|
|
3587
|
+
function createInnerComp(comp, parent) {
|
|
3588
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
3587
3589
|
const vnode = createVNode(comp, props, children);
|
|
3588
3590
|
// ensure inner component inherits the async wrapper's ref owner
|
|
3589
3591
|
vnode.ref = ref;
|
|
3592
|
+
// pass the custom element callback on to the inner comp
|
|
3593
|
+
// and remove it from the async wrapper
|
|
3594
|
+
vnode.ce = ce;
|
|
3595
|
+
delete parent.vnode.ce;
|
|
3590
3596
|
return vnode;
|
|
3591
3597
|
}
|
|
3592
3598
|
|
|
@@ -3738,8 +3744,7 @@ const KeepAliveImpl = {
|
|
|
3738
3744
|
: comp);
|
|
3739
3745
|
const { include, exclude, max } = props;
|
|
3740
3746
|
if ((include && (!name || !matches(include, name))) ||
|
|
3741
|
-
(exclude && name && matches(exclude, name))
|
|
3742
|
-
(false )) {
|
|
3747
|
+
(exclude && name && matches(exclude, name))) {
|
|
3743
3748
|
current = vnode;
|
|
3744
3749
|
return rawVNode;
|
|
3745
3750
|
}
|
|
@@ -3852,14 +3857,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
3852
3857
|
}, target);
|
|
3853
3858
|
}
|
|
3854
3859
|
function resetShapeFlag(vnode) {
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
}
|
|
3859
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
3860
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
3861
|
-
}
|
|
3862
|
-
vnode.shapeFlag = shapeFlag;
|
|
3860
|
+
// bitwise operations to remove keep alive flags
|
|
3861
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
3862
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
3863
3863
|
}
|
|
3864
3864
|
function getInnerChild(vnode) {
|
|
3865
3865
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -4458,7 +4458,9 @@ fallback, noSlotted) {
|
|
|
4458
4458
|
(currentRenderingInstance.parent &&
|
|
4459
4459
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
4460
4460
|
currentRenderingInstance.parent.isCE)) {
|
|
4461
|
-
|
|
4461
|
+
if (name !== 'default')
|
|
4462
|
+
props.name = name;
|
|
4463
|
+
return createVNode('slot', props, fallback && fallback());
|
|
4462
4464
|
}
|
|
4463
4465
|
let slot = slots[name];
|
|
4464
4466
|
// a compiled slot disables block tracking by default to avoid manual
|
|
@@ -4767,6 +4769,7 @@ const publicPropertiesMap =
|
|
|
4767
4769
|
{
|
|
4768
4770
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
4769
4771
|
}
|
|
4772
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
4770
4773
|
const PublicInstanceProxyHandlers = {
|
|
4771
4774
|
get({ _: instance }, key) {
|
|
4772
4775
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -4792,7 +4795,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4792
4795
|
// default: just fallthrough
|
|
4793
4796
|
}
|
|
4794
4797
|
}
|
|
4795
|
-
else if (
|
|
4798
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
4796
4799
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
4797
4800
|
return setupState[key];
|
|
4798
4801
|
}
|
|
@@ -4857,7 +4860,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4857
4860
|
},
|
|
4858
4861
|
set({ _: instance }, key, value) {
|
|
4859
4862
|
const { data, setupState, ctx } = instance;
|
|
4860
|
-
if (
|
|
4863
|
+
if (hasSetupBinding(setupState, key)) {
|
|
4861
4864
|
setupState[key] = value;
|
|
4862
4865
|
return true;
|
|
4863
4866
|
}
|
|
@@ -4882,7 +4885,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4882
4885
|
let normalizedProps;
|
|
4883
4886
|
return (!!accessCache[key] ||
|
|
4884
4887
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
4885
|
-
(setupState
|
|
4888
|
+
hasSetupBinding(setupState, key) ||
|
|
4886
4889
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
4887
4890
|
hasOwn(ctx, key) ||
|
|
4888
4891
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -5803,7 +5806,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5803
5806
|
return vm;
|
|
5804
5807
|
}
|
|
5805
5808
|
}
|
|
5806
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
5809
|
+
Vue.version = `2.6.14-compat:${"3.2.45"}`;
|
|
5807
5810
|
Vue.config = singletonApp.config;
|
|
5808
5811
|
Vue.use = (p, ...options) => {
|
|
5809
5812
|
if (p && isFunction(p.install)) {
|
|
@@ -7854,6 +7857,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7854
7857
|
if (!shallow)
|
|
7855
7858
|
traverseStaticChildren(c1, c2);
|
|
7856
7859
|
}
|
|
7860
|
+
// #6852 also inherit for text nodes
|
|
7861
|
+
if (c2.type === Text) {
|
|
7862
|
+
c2.el = c1.el;
|
|
7863
|
+
}
|
|
7857
7864
|
}
|
|
7858
7865
|
}
|
|
7859
7866
|
}
|
|
@@ -7994,6 +8001,7 @@ const TeleportImpl = {
|
|
|
7994
8001
|
}
|
|
7995
8002
|
}
|
|
7996
8003
|
}
|
|
8004
|
+
updateCssVars(n2);
|
|
7997
8005
|
},
|
|
7998
8006
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
7999
8007
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -8072,11 +8080,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
8072
8080
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
8073
8081
|
}
|
|
8074
8082
|
}
|
|
8083
|
+
updateCssVars(vnode);
|
|
8075
8084
|
}
|
|
8076
8085
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
8077
8086
|
}
|
|
8078
8087
|
// Force-casted public typing for h and TSX props inference
|
|
8079
8088
|
const Teleport = TeleportImpl;
|
|
8089
|
+
function updateCssVars(vnode) {
|
|
8090
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
8091
|
+
// code path here can assume browser environment.
|
|
8092
|
+
const ctx = vnode.ctx;
|
|
8093
|
+
if (ctx && ctx.ut) {
|
|
8094
|
+
let node = vnode.children[0].el;
|
|
8095
|
+
while (node !== vnode.targetAnchor) {
|
|
8096
|
+
if (node.nodeType === 1)
|
|
8097
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
8098
|
+
node = node.nextSibling;
|
|
8099
|
+
}
|
|
8100
|
+
ctx.ut();
|
|
8101
|
+
}
|
|
8102
|
+
}
|
|
8080
8103
|
|
|
8081
8104
|
const normalizedAsyncComponentMap = new Map();
|
|
8082
8105
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -8274,7 +8297,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8274
8297
|
patchFlag,
|
|
8275
8298
|
dynamicProps,
|
|
8276
8299
|
dynamicChildren: null,
|
|
8277
|
-
appContext: null
|
|
8300
|
+
appContext: null,
|
|
8301
|
+
ctx: currentRenderingInstance
|
|
8278
8302
|
};
|
|
8279
8303
|
if (needFullChildrenNormalization) {
|
|
8280
8304
|
normalizeChildren(vnode, children);
|
|
@@ -8433,7 +8457,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
8433
8457
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
8434
8458
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
8435
8459
|
el: vnode.el,
|
|
8436
|
-
anchor: vnode.anchor
|
|
8460
|
+
anchor: vnode.anchor,
|
|
8461
|
+
ctx: vnode.ctx
|
|
8437
8462
|
};
|
|
8438
8463
|
{
|
|
8439
8464
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -9082,7 +9107,7 @@ function isMemoSame(cached, memo) {
|
|
|
9082
9107
|
}
|
|
9083
9108
|
|
|
9084
9109
|
// Core API ------------------------------------------------------------------
|
|
9085
|
-
const version = "3.2.
|
|
9110
|
+
const version = "3.2.45";
|
|
9086
9111
|
const _ssrUtils = {
|
|
9087
9112
|
createComponentInstance,
|
|
9088
9113
|
setupComponent,
|
|
@@ -9608,12 +9633,21 @@ class VueElement extends BaseClass {
|
|
|
9608
9633
|
}
|
|
9609
9634
|
else {
|
|
9610
9635
|
this.attachShadow({ mode: 'open' });
|
|
9636
|
+
if (!this._def.__asyncLoader) {
|
|
9637
|
+
// for sync component defs we can immediately resolve props
|
|
9638
|
+
this._resolveProps(this._def);
|
|
9639
|
+
}
|
|
9611
9640
|
}
|
|
9612
9641
|
}
|
|
9613
9642
|
connectedCallback() {
|
|
9614
9643
|
this._connected = true;
|
|
9615
9644
|
if (!this._instance) {
|
|
9616
|
-
this.
|
|
9645
|
+
if (this._resolved) {
|
|
9646
|
+
this._update();
|
|
9647
|
+
}
|
|
9648
|
+
else {
|
|
9649
|
+
this._resolveDef();
|
|
9650
|
+
}
|
|
9617
9651
|
}
|
|
9618
9652
|
}
|
|
9619
9653
|
disconnectedCallback() {
|
|
@@ -9629,9 +9663,6 @@ class VueElement extends BaseClass {
|
|
|
9629
9663
|
* resolve inner component definition (handle possible async component)
|
|
9630
9664
|
*/
|
|
9631
9665
|
_resolveDef() {
|
|
9632
|
-
if (this._resolved) {
|
|
9633
|
-
return;
|
|
9634
|
-
}
|
|
9635
9666
|
this._resolved = true;
|
|
9636
9667
|
// set initial attrs
|
|
9637
9668
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -9643,38 +9674,26 @@ class VueElement extends BaseClass {
|
|
|
9643
9674
|
this._setAttr(m.attributeName);
|
|
9644
9675
|
}
|
|
9645
9676
|
}).observe(this, { attributes: true });
|
|
9646
|
-
const resolve = (def) => {
|
|
9647
|
-
const { props
|
|
9648
|
-
const hasOptions = !isArray(props);
|
|
9649
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
9677
|
+
const resolve = (def, isAsync = false) => {
|
|
9678
|
+
const { props, styles } = def;
|
|
9650
9679
|
// cast Number-type props set before resolve
|
|
9651
9680
|
let numberProps;
|
|
9652
|
-
if (
|
|
9653
|
-
for (const key in
|
|
9681
|
+
if (props && !isArray(props)) {
|
|
9682
|
+
for (const key in props) {
|
|
9654
9683
|
const opt = props[key];
|
|
9655
9684
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
9656
|
-
|
|
9657
|
-
|
|
9685
|
+
if (key in this._props) {
|
|
9686
|
+
this._props[key] = toNumber(this._props[key]);
|
|
9687
|
+
}
|
|
9688
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
9658
9689
|
}
|
|
9659
9690
|
}
|
|
9660
9691
|
}
|
|
9661
9692
|
this._numberProps = numberProps;
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
}
|
|
9667
|
-
}
|
|
9668
|
-
// defining getter/setters on prototype
|
|
9669
|
-
for (const key of rawKeys.map(camelize)) {
|
|
9670
|
-
Object.defineProperty(this, key, {
|
|
9671
|
-
get() {
|
|
9672
|
-
return this._getProp(key);
|
|
9673
|
-
},
|
|
9674
|
-
set(val) {
|
|
9675
|
-
this._setProp(key, val);
|
|
9676
|
-
}
|
|
9677
|
-
});
|
|
9693
|
+
if (isAsync) {
|
|
9694
|
+
// defining getter/setters on prototype
|
|
9695
|
+
// for sync defs, this already happened in the constructor
|
|
9696
|
+
this._resolveProps(def);
|
|
9678
9697
|
}
|
|
9679
9698
|
// apply CSS
|
|
9680
9699
|
this._applyStyles(styles);
|
|
@@ -9683,12 +9702,33 @@ class VueElement extends BaseClass {
|
|
|
9683
9702
|
};
|
|
9684
9703
|
const asyncDef = this._def.__asyncLoader;
|
|
9685
9704
|
if (asyncDef) {
|
|
9686
|
-
asyncDef().then(resolve);
|
|
9705
|
+
asyncDef().then(def => resolve(def, true));
|
|
9687
9706
|
}
|
|
9688
9707
|
else {
|
|
9689
9708
|
resolve(this._def);
|
|
9690
9709
|
}
|
|
9691
9710
|
}
|
|
9711
|
+
_resolveProps(def) {
|
|
9712
|
+
const { props } = def;
|
|
9713
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
9714
|
+
// check if there are props set pre-upgrade or connect
|
|
9715
|
+
for (const key of Object.keys(this)) {
|
|
9716
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
9717
|
+
this._setProp(key, this[key], true, false);
|
|
9718
|
+
}
|
|
9719
|
+
}
|
|
9720
|
+
// defining getter/setters on prototype
|
|
9721
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
9722
|
+
Object.defineProperty(this, key, {
|
|
9723
|
+
get() {
|
|
9724
|
+
return this._getProp(key);
|
|
9725
|
+
},
|
|
9726
|
+
set(val) {
|
|
9727
|
+
this._setProp(key, val);
|
|
9728
|
+
}
|
|
9729
|
+
});
|
|
9730
|
+
}
|
|
9731
|
+
}
|
|
9692
9732
|
_setAttr(key) {
|
|
9693
9733
|
let value = this.getAttribute(key);
|
|
9694
9734
|
const camelKey = camelize(key);
|
|
@@ -9735,18 +9775,27 @@ class VueElement extends BaseClass {
|
|
|
9735
9775
|
vnode.ce = instance => {
|
|
9736
9776
|
this._instance = instance;
|
|
9737
9777
|
instance.isCE = true;
|
|
9738
|
-
|
|
9739
|
-
instance.emit = (event, ...args) => {
|
|
9778
|
+
const dispatch = (event, args) => {
|
|
9740
9779
|
this.dispatchEvent(new CustomEvent(event, {
|
|
9741
9780
|
detail: args
|
|
9742
9781
|
}));
|
|
9743
9782
|
};
|
|
9783
|
+
// intercept emit
|
|
9784
|
+
instance.emit = (event, ...args) => {
|
|
9785
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
9786
|
+
// to match Vue behavior
|
|
9787
|
+
dispatch(event, args);
|
|
9788
|
+
if (hyphenate(event) !== event) {
|
|
9789
|
+
dispatch(hyphenate(event), args);
|
|
9790
|
+
}
|
|
9791
|
+
};
|
|
9744
9792
|
// locate nearest Vue custom element parent for provide/inject
|
|
9745
9793
|
let parent = this;
|
|
9746
9794
|
while ((parent =
|
|
9747
9795
|
parent && (parent.parentNode || parent.host))) {
|
|
9748
9796
|
if (parent instanceof VueElement) {
|
|
9749
9797
|
instance.parent = parent._instance;
|
|
9798
|
+
instance.provides = parent._instance.provides;
|
|
9750
9799
|
break;
|
|
9751
9800
|
}
|
|
9752
9801
|
}
|
|
@@ -10960,15 +11009,16 @@ const errorMessages = {
|
|
|
10960
11009
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
10961
11010
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
10962
11011
|
[43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
10963
|
-
[44 /* ErrorCodes.
|
|
10964
|
-
[45 /* ErrorCodes.
|
|
11012
|
+
[44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
11013
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
11014
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
10965
11015
|
// generic errors
|
|
10966
|
-
[
|
|
10967
|
-
[
|
|
10968
|
-
[
|
|
10969
|
-
[
|
|
11016
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
11017
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
11018
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
11019
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
10970
11020
|
// just to fulfill types
|
|
10971
|
-
[
|
|
11021
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
10972
11022
|
};
|
|
10973
11023
|
|
|
10974
11024
|
const FRAGMENT = Symbol(``);
|
|
@@ -14123,7 +14173,7 @@ asRawStatements = false, localVars = Object.create(context.identifiers)) {
|
|
|
14123
14173
|
}).program;
|
|
14124
14174
|
}
|
|
14125
14175
|
catch (e) {
|
|
14126
|
-
context.onError(createCompilerError(
|
|
14176
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, e.message));
|
|
14127
14177
|
return node;
|
|
14128
14178
|
}
|
|
14129
14179
|
const ids = [];
|
|
@@ -15934,9 +15984,16 @@ const transformModel = (dir, node, context) => {
|
|
|
15934
15984
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
15935
15985
|
// _unref(exp)
|
|
15936
15986
|
const bindingType = context.bindingMetadata[rawExp];
|
|
15987
|
+
// check props
|
|
15988
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
15989
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
15990
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
15991
|
+
return createTransformProps();
|
|
15992
|
+
}
|
|
15937
15993
|
const maybeRef = context.inline &&
|
|
15938
|
-
bindingType
|
|
15939
|
-
|
|
15994
|
+
(bindingType === "setup-let" /* BindingTypes.SETUP_LET */ ||
|
|
15995
|
+
bindingType === "setup-ref" /* BindingTypes.SETUP_REF */ ||
|
|
15996
|
+
bindingType === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
|
|
15940
15997
|
if (!expString.trim() ||
|
|
15941
15998
|
(!isMemberExpression(expString, context) && !maybeRef)) {
|
|
15942
15999
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -16239,10 +16296,10 @@ function baseCompile(template, options = {}) {
|
|
|
16239
16296
|
const isModuleMode = options.mode === 'module';
|
|
16240
16297
|
const prefixIdentifiers = (options.prefixIdentifiers === true || isModuleMode);
|
|
16241
16298
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
16242
|
-
onError(createCompilerError(
|
|
16299
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
16243
16300
|
}
|
|
16244
16301
|
if (options.scopeId && !isModuleMode) {
|
|
16245
|
-
onError(createCompilerError(
|
|
16302
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
16246
16303
|
}
|
|
16247
16304
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
16248
16305
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -18746,26 +18803,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
18746
18803
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
18747
18804
|
}
|
|
18748
18805
|
const DOMErrorMessages = {
|
|
18749
|
-
[
|
|
18750
|
-
[
|
|
18751
|
-
[
|
|
18752
|
-
[
|
|
18753
|
-
[
|
|
18754
|
-
[
|
|
18755
|
-
[
|
|
18756
|
-
[
|
|
18757
|
-
[
|
|
18758
|
-
[
|
|
18759
|
-
[
|
|
18806
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
18807
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
18808
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
18809
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
18810
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
18811
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
18812
|
+
[57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
18813
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
18814
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
18815
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
18816
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
18760
18817
|
};
|
|
18761
18818
|
|
|
18762
18819
|
const transformVHtml = (dir, node, context) => {
|
|
18763
18820
|
const { exp, loc } = dir;
|
|
18764
18821
|
if (!exp) {
|
|
18765
|
-
context.onError(createDOMCompilerError(
|
|
18822
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
18766
18823
|
}
|
|
18767
18824
|
if (node.children.length) {
|
|
18768
|
-
context.onError(createDOMCompilerError(
|
|
18825
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
18769
18826
|
node.children.length = 0;
|
|
18770
18827
|
}
|
|
18771
18828
|
return {
|
|
@@ -18778,10 +18835,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
18778
18835
|
const transformVText = (dir, node, context) => {
|
|
18779
18836
|
const { exp, loc } = dir;
|
|
18780
18837
|
if (!exp) {
|
|
18781
|
-
context.onError(createDOMCompilerError(
|
|
18838
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
18782
18839
|
}
|
|
18783
18840
|
if (node.children.length) {
|
|
18784
|
-
context.onError(createDOMCompilerError(
|
|
18841
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
18785
18842
|
node.children.length = 0;
|
|
18786
18843
|
}
|
|
18787
18844
|
return {
|
|
@@ -18802,7 +18859,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18802
18859
|
return baseResult;
|
|
18803
18860
|
}
|
|
18804
18861
|
if (dir.arg) {
|
|
18805
|
-
context.onError(createDOMCompilerError(
|
|
18862
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
18806
18863
|
}
|
|
18807
18864
|
const { tag } = node;
|
|
18808
18865
|
const isCustomElement = context.isCustomElement(tag);
|
|
@@ -18829,7 +18886,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18829
18886
|
break;
|
|
18830
18887
|
case 'file':
|
|
18831
18888
|
isInvalidType = true;
|
|
18832
|
-
context.onError(createDOMCompilerError(
|
|
18889
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
18833
18890
|
break;
|
|
18834
18891
|
}
|
|
18835
18892
|
}
|
|
@@ -18853,7 +18910,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
18853
18910
|
}
|
|
18854
18911
|
}
|
|
18855
18912
|
else {
|
|
18856
|
-
context.onError(createDOMCompilerError(
|
|
18913
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
18857
18914
|
}
|
|
18858
18915
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
18859
18916
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -18977,7 +19034,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
18977
19034
|
const transformShow = (dir, node, context) => {
|
|
18978
19035
|
const { exp, loc } = dir;
|
|
18979
19036
|
if (!exp) {
|
|
18980
|
-
context.onError(createDOMCompilerError(
|
|
19037
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
18981
19038
|
}
|
|
18982
19039
|
return {
|
|
18983
19040
|
props: [],
|
|
@@ -19285,7 +19342,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
19285
19342
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
19286
19343
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
19287
19344
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
19288
|
-
context.onError(createDOMCompilerError(
|
|
19345
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
19289
19346
|
context.removeNode();
|
|
19290
19347
|
}
|
|
19291
19348
|
};
|