@vue/compat 3.2.44 → 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 +154 -109
- package/dist/vue.cjs.prod.js +138 -82
- package/dist/vue.esm-browser.js +163 -112
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +164 -114
- package/dist/vue.global.js +163 -112
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +119 -75
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +120 -77
- package/dist/vue.runtime.global.js +119 -75
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.js
CHANGED
|
@@ -2238,12 +2238,6 @@ function reload(id, newComp) {
|
|
|
2238
2238
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2239
2239
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2240
2240
|
queueJob(instance.parent.update);
|
|
2241
|
-
// instance is the inner component of an async custom element
|
|
2242
|
-
// invoke to reset styles
|
|
2243
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2244
|
-
instance.parent.ceReload) {
|
|
2245
|
-
instance.parent.ceReload(newComp.styles);
|
|
2246
|
-
}
|
|
2247
2241
|
}
|
|
2248
2242
|
else if (instance.appContext.reload) {
|
|
2249
2243
|
// root instance mounted via createApp() has a reload method
|
|
@@ -4684,10 +4678,15 @@ function defineAsyncComponent(source) {
|
|
|
4684
4678
|
}
|
|
4685
4679
|
});
|
|
4686
4680
|
}
|
|
4687
|
-
function createInnerComp(comp,
|
|
4681
|
+
function createInnerComp(comp, parent) {
|
|
4682
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
4688
4683
|
const vnode = createVNode(comp, props, children);
|
|
4689
4684
|
// ensure inner component inherits the async wrapper's ref owner
|
|
4690
4685
|
vnode.ref = ref;
|
|
4686
|
+
// pass the custom element callback on to the inner comp
|
|
4687
|
+
// and remove it from the async wrapper
|
|
4688
|
+
vnode.ce = ce;
|
|
4689
|
+
delete parent.vnode.ce;
|
|
4691
4690
|
return vnode;
|
|
4692
4691
|
}
|
|
4693
4692
|
|
|
@@ -4853,8 +4852,7 @@ const KeepAliveImpl = {
|
|
|
4853
4852
|
: comp);
|
|
4854
4853
|
const { include, exclude, max } = props;
|
|
4855
4854
|
if ((include && (!name || !matches(include, name))) ||
|
|
4856
|
-
(exclude && name && matches(exclude, name))
|
|
4857
|
-
(hmrDirtyComponents.has(comp))) {
|
|
4855
|
+
(exclude && name && matches(exclude, name))) {
|
|
4858
4856
|
current = vnode;
|
|
4859
4857
|
return rawVNode;
|
|
4860
4858
|
}
|
|
@@ -4967,14 +4965,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4967
4965
|
}, target);
|
|
4968
4966
|
}
|
|
4969
4967
|
function resetShapeFlag(vnode) {
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
}
|
|
4974
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4975
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4976
|
-
}
|
|
4977
|
-
vnode.shapeFlag = shapeFlag;
|
|
4968
|
+
// bitwise operations to remove keep alive flags
|
|
4969
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4970
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4978
4971
|
}
|
|
4979
4972
|
function getInnerChild(vnode) {
|
|
4980
4973
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -5602,7 +5595,9 @@ fallback, noSlotted) {
|
|
|
5602
5595
|
(currentRenderingInstance.parent &&
|
|
5603
5596
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
5604
5597
|
currentRenderingInstance.parent.isCE)) {
|
|
5605
|
-
|
|
5598
|
+
if (name !== 'default')
|
|
5599
|
+
props.name = name;
|
|
5600
|
+
return createVNode('slot', props, fallback && fallback());
|
|
5606
5601
|
}
|
|
5607
5602
|
let slot = slots[name];
|
|
5608
5603
|
if (slot && slot.length > 1) {
|
|
@@ -5922,6 +5917,7 @@ const publicPropertiesMap =
|
|
|
5922
5917
|
installCompatInstanceProperties(publicPropertiesMap);
|
|
5923
5918
|
}
|
|
5924
5919
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
5920
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
5925
5921
|
const PublicInstanceProxyHandlers = {
|
|
5926
5922
|
get({ _: instance }, key) {
|
|
5927
5923
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -5929,15 +5925,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
5929
5925
|
if (key === '__isVue') {
|
|
5930
5926
|
return true;
|
|
5931
5927
|
}
|
|
5932
|
-
// prioritize <script setup> bindings during dev.
|
|
5933
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
5934
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
5935
|
-
// indeed has access to all declared variables.
|
|
5936
|
-
if (setupState !== EMPTY_OBJ &&
|
|
5937
|
-
setupState.__isScriptSetup &&
|
|
5938
|
-
hasOwn(setupState, key)) {
|
|
5939
|
-
return setupState[key];
|
|
5940
|
-
}
|
|
5941
5928
|
// data / props / ctx
|
|
5942
5929
|
// This getter gets called for every property access on the render context
|
|
5943
5930
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -5960,7 +5947,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
5960
5947
|
// default: just fallthrough
|
|
5961
5948
|
}
|
|
5962
5949
|
}
|
|
5963
|
-
else if (
|
|
5950
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
5964
5951
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
5965
5952
|
return setupState[key];
|
|
5966
5953
|
}
|
|
@@ -6039,21 +6026,26 @@ const PublicInstanceProxyHandlers = {
|
|
|
6039
6026
|
},
|
|
6040
6027
|
set({ _: instance }, key, value) {
|
|
6041
6028
|
const { data, setupState, ctx } = instance;
|
|
6042
|
-
if (
|
|
6029
|
+
if (hasSetupBinding(setupState, key)) {
|
|
6043
6030
|
setupState[key] = value;
|
|
6044
6031
|
return true;
|
|
6045
6032
|
}
|
|
6033
|
+
else if (setupState.__isScriptSetup &&
|
|
6034
|
+
hasOwn(setupState, key)) {
|
|
6035
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
6036
|
+
return false;
|
|
6037
|
+
}
|
|
6046
6038
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
6047
6039
|
data[key] = value;
|
|
6048
6040
|
return true;
|
|
6049
6041
|
}
|
|
6050
6042
|
else if (hasOwn(instance.props, key)) {
|
|
6051
|
-
warn$1(`Attempting to mutate prop "${key}". Props are readonly
|
|
6043
|
+
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
6052
6044
|
return false;
|
|
6053
6045
|
}
|
|
6054
6046
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
6055
6047
|
warn$1(`Attempting to mutate public property "${key}". ` +
|
|
6056
|
-
`Properties starting with $ are reserved and readonly
|
|
6048
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
6057
6049
|
return false;
|
|
6058
6050
|
}
|
|
6059
6051
|
else {
|
|
@@ -6074,7 +6066,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
6074
6066
|
let normalizedProps;
|
|
6075
6067
|
return (!!accessCache[key] ||
|
|
6076
6068
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
6077
|
-
(setupState
|
|
6069
|
+
hasSetupBinding(setupState, key) ||
|
|
6078
6070
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
6079
6071
|
hasOwn(ctx, key) ||
|
|
6080
6072
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -7349,7 +7341,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7349
7341
|
return vm;
|
|
7350
7342
|
}
|
|
7351
7343
|
}
|
|
7352
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7344
|
+
Vue.version = `2.6.14-compat:${"3.2.45"}`;
|
|
7353
7345
|
Vue.config = singletonApp.config;
|
|
7354
7346
|
Vue.use = (p, ...options) => {
|
|
7355
7347
|
if (p && isFunction(p.install)) {
|
|
@@ -9736,6 +9728,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
9736
9728
|
if (!shallow)
|
|
9737
9729
|
traverseStaticChildren(c1, c2);
|
|
9738
9730
|
}
|
|
9731
|
+
// #6852 also inherit for text nodes
|
|
9732
|
+
if (c2.type === Text) {
|
|
9733
|
+
c2.el = c1.el;
|
|
9734
|
+
}
|
|
9739
9735
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
9740
9736
|
// would have received .el during block patch)
|
|
9741
9737
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -9906,6 +9902,7 @@ const TeleportImpl = {
|
|
|
9906
9902
|
}
|
|
9907
9903
|
}
|
|
9908
9904
|
}
|
|
9905
|
+
updateCssVars(n2);
|
|
9909
9906
|
},
|
|
9910
9907
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
9911
9908
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -9984,11 +9981,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9984
9981
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9985
9982
|
}
|
|
9986
9983
|
}
|
|
9984
|
+
updateCssVars(vnode);
|
|
9987
9985
|
}
|
|
9988
9986
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
9989
9987
|
}
|
|
9990
9988
|
// Force-casted public typing for h and TSX props inference
|
|
9991
9989
|
const Teleport = TeleportImpl;
|
|
9990
|
+
function updateCssVars(vnode) {
|
|
9991
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
9992
|
+
// code path here can assume browser environment.
|
|
9993
|
+
const ctx = vnode.ctx;
|
|
9994
|
+
if (ctx && ctx.ut) {
|
|
9995
|
+
let node = vnode.children[0].el;
|
|
9996
|
+
while (node !== vnode.targetAnchor) {
|
|
9997
|
+
if (node.nodeType === 1)
|
|
9998
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
9999
|
+
node = node.nextSibling;
|
|
10000
|
+
}
|
|
10001
|
+
ctx.ut();
|
|
10002
|
+
}
|
|
10003
|
+
}
|
|
9992
10004
|
|
|
9993
10005
|
const normalizedAsyncComponentMap = new Map();
|
|
9994
10006
|
function convertLegacyAsyncComponent(comp) {
|
|
@@ -10143,6 +10155,10 @@ function isVNode(value) {
|
|
|
10143
10155
|
function isSameVNodeType(n1, n2) {
|
|
10144
10156
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
10145
10157
|
hmrDirtyComponents.has(n2.type)) {
|
|
10158
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
10159
|
+
// bitwise operations to remove keep alive flags
|
|
10160
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
10161
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
10146
10162
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
10147
10163
|
return false;
|
|
10148
10164
|
}
|
|
@@ -10198,7 +10214,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
10198
10214
|
patchFlag,
|
|
10199
10215
|
dynamicProps,
|
|
10200
10216
|
dynamicChildren: null,
|
|
10201
|
-
appContext: null
|
|
10217
|
+
appContext: null,
|
|
10218
|
+
ctx: currentRenderingInstance
|
|
10202
10219
|
};
|
|
10203
10220
|
if (needFullChildrenNormalization) {
|
|
10204
10221
|
normalizeChildren(vnode, children);
|
|
@@ -10373,7 +10390,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
10373
10390
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
10374
10391
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
10375
10392
|
el: vnode.el,
|
|
10376
|
-
anchor: vnode.anchor
|
|
10393
|
+
anchor: vnode.anchor,
|
|
10394
|
+
ctx: vnode.ctx
|
|
10377
10395
|
};
|
|
10378
10396
|
{
|
|
10379
10397
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -11365,7 +11383,7 @@ function isMemoSame(cached, memo) {
|
|
|
11365
11383
|
}
|
|
11366
11384
|
|
|
11367
11385
|
// Core API ------------------------------------------------------------------
|
|
11368
|
-
const version = "3.2.
|
|
11386
|
+
const version = "3.2.45";
|
|
11369
11387
|
const _ssrUtils = {
|
|
11370
11388
|
createComponentInstance,
|
|
11371
11389
|
setupComponent,
|
|
@@ -11907,12 +11925,21 @@ class VueElement extends BaseClass {
|
|
|
11907
11925
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
11908
11926
|
}
|
|
11909
11927
|
this.attachShadow({ mode: 'open' });
|
|
11928
|
+
if (!this._def.__asyncLoader) {
|
|
11929
|
+
// for sync component defs we can immediately resolve props
|
|
11930
|
+
this._resolveProps(this._def);
|
|
11931
|
+
}
|
|
11910
11932
|
}
|
|
11911
11933
|
}
|
|
11912
11934
|
connectedCallback() {
|
|
11913
11935
|
this._connected = true;
|
|
11914
11936
|
if (!this._instance) {
|
|
11915
|
-
this.
|
|
11937
|
+
if (this._resolved) {
|
|
11938
|
+
this._update();
|
|
11939
|
+
}
|
|
11940
|
+
else {
|
|
11941
|
+
this._resolveDef();
|
|
11942
|
+
}
|
|
11916
11943
|
}
|
|
11917
11944
|
}
|
|
11918
11945
|
disconnectedCallback() {
|
|
@@ -11928,9 +11955,6 @@ class VueElement extends BaseClass {
|
|
|
11928
11955
|
* resolve inner component definition (handle possible async component)
|
|
11929
11956
|
*/
|
|
11930
11957
|
_resolveDef() {
|
|
11931
|
-
if (this._resolved) {
|
|
11932
|
-
return;
|
|
11933
|
-
}
|
|
11934
11958
|
this._resolved = true;
|
|
11935
11959
|
// set initial attrs
|
|
11936
11960
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -11942,38 +11966,26 @@ class VueElement extends BaseClass {
|
|
|
11942
11966
|
this._setAttr(m.attributeName);
|
|
11943
11967
|
}
|
|
11944
11968
|
}).observe(this, { attributes: true });
|
|
11945
|
-
const resolve = (def) => {
|
|
11946
|
-
const { props
|
|
11947
|
-
const hasOptions = !isArray(props);
|
|
11948
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
11969
|
+
const resolve = (def, isAsync = false) => {
|
|
11970
|
+
const { props, styles } = def;
|
|
11949
11971
|
// cast Number-type props set before resolve
|
|
11950
11972
|
let numberProps;
|
|
11951
|
-
if (
|
|
11952
|
-
for (const key in
|
|
11973
|
+
if (props && !isArray(props)) {
|
|
11974
|
+
for (const key in props) {
|
|
11953
11975
|
const opt = props[key];
|
|
11954
11976
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
11955
|
-
|
|
11956
|
-
|
|
11977
|
+
if (key in this._props) {
|
|
11978
|
+
this._props[key] = toNumber(this._props[key]);
|
|
11979
|
+
}
|
|
11980
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
11957
11981
|
}
|
|
11958
11982
|
}
|
|
11959
11983
|
}
|
|
11960
11984
|
this._numberProps = numberProps;
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
}
|
|
11966
|
-
}
|
|
11967
|
-
// defining getter/setters on prototype
|
|
11968
|
-
for (const key of rawKeys.map(camelize)) {
|
|
11969
|
-
Object.defineProperty(this, key, {
|
|
11970
|
-
get() {
|
|
11971
|
-
return this._getProp(key);
|
|
11972
|
-
},
|
|
11973
|
-
set(val) {
|
|
11974
|
-
this._setProp(key, val);
|
|
11975
|
-
}
|
|
11976
|
-
});
|
|
11985
|
+
if (isAsync) {
|
|
11986
|
+
// defining getter/setters on prototype
|
|
11987
|
+
// for sync defs, this already happened in the constructor
|
|
11988
|
+
this._resolveProps(def);
|
|
11977
11989
|
}
|
|
11978
11990
|
// apply CSS
|
|
11979
11991
|
this._applyStyles(styles);
|
|
@@ -11982,12 +11994,33 @@ class VueElement extends BaseClass {
|
|
|
11982
11994
|
};
|
|
11983
11995
|
const asyncDef = this._def.__asyncLoader;
|
|
11984
11996
|
if (asyncDef) {
|
|
11985
|
-
asyncDef().then(resolve);
|
|
11997
|
+
asyncDef().then(def => resolve(def, true));
|
|
11986
11998
|
}
|
|
11987
11999
|
else {
|
|
11988
12000
|
resolve(this._def);
|
|
11989
12001
|
}
|
|
11990
12002
|
}
|
|
12003
|
+
_resolveProps(def) {
|
|
12004
|
+
const { props } = def;
|
|
12005
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
12006
|
+
// check if there are props set pre-upgrade or connect
|
|
12007
|
+
for (const key of Object.keys(this)) {
|
|
12008
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
12009
|
+
this._setProp(key, this[key], true, false);
|
|
12010
|
+
}
|
|
12011
|
+
}
|
|
12012
|
+
// defining getter/setters on prototype
|
|
12013
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
12014
|
+
Object.defineProperty(this, key, {
|
|
12015
|
+
get() {
|
|
12016
|
+
return this._getProp(key);
|
|
12017
|
+
},
|
|
12018
|
+
set(val) {
|
|
12019
|
+
this._setProp(key, val);
|
|
12020
|
+
}
|
|
12021
|
+
});
|
|
12022
|
+
}
|
|
12023
|
+
}
|
|
11991
12024
|
_setAttr(key) {
|
|
11992
12025
|
let value = this.getAttribute(key);
|
|
11993
12026
|
const camelKey = camelize(key);
|
|
@@ -12043,27 +12076,31 @@ class VueElement extends BaseClass {
|
|
|
12043
12076
|
this._styles.length = 0;
|
|
12044
12077
|
}
|
|
12045
12078
|
this._applyStyles(newStyles);
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
if (!this._def.__asyncLoader) {
|
|
12049
|
-
// reload
|
|
12050
|
-
this._instance = null;
|
|
12051
|
-
this._update();
|
|
12052
|
-
}
|
|
12079
|
+
this._instance = null;
|
|
12080
|
+
this._update();
|
|
12053
12081
|
};
|
|
12054
12082
|
}
|
|
12055
|
-
|
|
12056
|
-
instance.emit = (event, ...args) => {
|
|
12083
|
+
const dispatch = (event, args) => {
|
|
12057
12084
|
this.dispatchEvent(new CustomEvent(event, {
|
|
12058
12085
|
detail: args
|
|
12059
12086
|
}));
|
|
12060
12087
|
};
|
|
12088
|
+
// intercept emit
|
|
12089
|
+
instance.emit = (event, ...args) => {
|
|
12090
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
12091
|
+
// to match Vue behavior
|
|
12092
|
+
dispatch(event, args);
|
|
12093
|
+
if (hyphenate(event) !== event) {
|
|
12094
|
+
dispatch(hyphenate(event), args);
|
|
12095
|
+
}
|
|
12096
|
+
};
|
|
12061
12097
|
// locate nearest Vue custom element parent for provide/inject
|
|
12062
12098
|
let parent = this;
|
|
12063
12099
|
while ((parent =
|
|
12064
12100
|
parent && (parent.parentNode || parent.host))) {
|
|
12065
12101
|
if (parent instanceof VueElement) {
|
|
12066
12102
|
instance.parent = parent._instance;
|
|
12103
|
+
instance.provides = parent._instance.provides;
|
|
12067
12104
|
break;
|
|
12068
12105
|
}
|
|
12069
12106
|
}
|
|
@@ -13370,15 +13407,16 @@ const errorMessages = {
|
|
|
13370
13407
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
13371
13408
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
13372
13409
|
[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.`,
|
|
13373
|
-
[44 /* ErrorCodes.
|
|
13374
|
-
[45 /* ErrorCodes.
|
|
13410
|
+
[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.`,
|
|
13411
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
13412
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
13375
13413
|
// generic errors
|
|
13376
|
-
[
|
|
13377
|
-
[
|
|
13378
|
-
[
|
|
13379
|
-
[
|
|
13414
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13415
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
13416
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13417
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
13380
13418
|
// just to fulfill types
|
|
13381
|
-
[
|
|
13419
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
13382
13420
|
};
|
|
13383
13421
|
|
|
13384
13422
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -16667,7 +16705,7 @@ asRawStatements = false, localVars = Object.create(context.identifiers)) {
|
|
|
16667
16705
|
}).program;
|
|
16668
16706
|
}
|
|
16669
16707
|
catch (e) {
|
|
16670
|
-
context.onError(createCompilerError(
|
|
16708
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, e.message));
|
|
16671
16709
|
return node;
|
|
16672
16710
|
}
|
|
16673
16711
|
const ids = [];
|
|
@@ -17567,7 +17605,7 @@ const transformElement = (node, context) => {
|
|
|
17567
17605
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
17568
17606
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
17569
17607
|
if (node.children.length > 1) {
|
|
17570
|
-
context.onError(createCompilerError(
|
|
17608
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
17571
17609
|
start: node.children[0].loc.start,
|
|
17572
17610
|
end: node.children[node.children.length - 1].loc.end,
|
|
17573
17611
|
source: ''
|
|
@@ -18538,9 +18576,16 @@ const transformModel = (dir, node, context) => {
|
|
|
18538
18576
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
18539
18577
|
// _unref(exp)
|
|
18540
18578
|
const bindingType = context.bindingMetadata[rawExp];
|
|
18579
|
+
// check props
|
|
18580
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
18581
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
18582
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
18583
|
+
return createTransformProps();
|
|
18584
|
+
}
|
|
18541
18585
|
const maybeRef = context.inline &&
|
|
18542
|
-
bindingType
|
|
18543
|
-
|
|
18586
|
+
(bindingType === "setup-let" /* BindingTypes.SETUP_LET */ ||
|
|
18587
|
+
bindingType === "setup-ref" /* BindingTypes.SETUP_REF */ ||
|
|
18588
|
+
bindingType === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
|
|
18544
18589
|
if (!expString.trim() ||
|
|
18545
18590
|
(!isMemberExpression(expString, context) && !maybeRef)) {
|
|
18546
18591
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -18844,10 +18889,10 @@ function baseCompile(template, options = {}) {
|
|
|
18844
18889
|
const isModuleMode = options.mode === 'module';
|
|
18845
18890
|
const prefixIdentifiers = (options.prefixIdentifiers === true || isModuleMode);
|
|
18846
18891
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
18847
|
-
onError(createCompilerError(
|
|
18892
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
18848
18893
|
}
|
|
18849
18894
|
if (options.scopeId && !isModuleMode) {
|
|
18850
|
-
onError(createCompilerError(
|
|
18895
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
18851
18896
|
}
|
|
18852
18897
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
18853
18898
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -21351,26 +21396,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
21351
21396
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
21352
21397
|
}
|
|
21353
21398
|
const DOMErrorMessages = {
|
|
21354
|
-
[
|
|
21355
|
-
[
|
|
21356
|
-
[
|
|
21357
|
-
[
|
|
21358
|
-
[
|
|
21359
|
-
[
|
|
21360
|
-
[
|
|
21361
|
-
[
|
|
21362
|
-
[
|
|
21363
|
-
[
|
|
21364
|
-
[
|
|
21399
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
21400
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
21401
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
21402
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
21403
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
21404
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
21405
|
+
[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.`,
|
|
21406
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
21407
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
21408
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
21409
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
21365
21410
|
};
|
|
21366
21411
|
|
|
21367
21412
|
const transformVHtml = (dir, node, context) => {
|
|
21368
21413
|
const { exp, loc } = dir;
|
|
21369
21414
|
if (!exp) {
|
|
21370
|
-
context.onError(createDOMCompilerError(
|
|
21415
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
21371
21416
|
}
|
|
21372
21417
|
if (node.children.length) {
|
|
21373
|
-
context.onError(createDOMCompilerError(
|
|
21418
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
21374
21419
|
node.children.length = 0;
|
|
21375
21420
|
}
|
|
21376
21421
|
return {
|
|
@@ -21383,10 +21428,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
21383
21428
|
const transformVText = (dir, node, context) => {
|
|
21384
21429
|
const { exp, loc } = dir;
|
|
21385
21430
|
if (!exp) {
|
|
21386
|
-
context.onError(createDOMCompilerError(
|
|
21431
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
21387
21432
|
}
|
|
21388
21433
|
if (node.children.length) {
|
|
21389
|
-
context.onError(createDOMCompilerError(
|
|
21434
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
21390
21435
|
node.children.length = 0;
|
|
21391
21436
|
}
|
|
21392
21437
|
return {
|
|
@@ -21407,12 +21452,12 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
21407
21452
|
return baseResult;
|
|
21408
21453
|
}
|
|
21409
21454
|
if (dir.arg) {
|
|
21410
|
-
context.onError(createDOMCompilerError(
|
|
21455
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
21411
21456
|
}
|
|
21412
21457
|
function checkDuplicatedValue() {
|
|
21413
21458
|
const value = findProp(node, 'value');
|
|
21414
21459
|
if (value) {
|
|
21415
|
-
context.onError(createDOMCompilerError(
|
|
21460
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
21416
21461
|
}
|
|
21417
21462
|
}
|
|
21418
21463
|
const { tag } = node;
|
|
@@ -21440,7 +21485,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
21440
21485
|
break;
|
|
21441
21486
|
case 'file':
|
|
21442
21487
|
isInvalidType = true;
|
|
21443
|
-
context.onError(createDOMCompilerError(
|
|
21488
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
21444
21489
|
break;
|
|
21445
21490
|
default:
|
|
21446
21491
|
// text type
|
|
@@ -21474,7 +21519,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
21474
21519
|
}
|
|
21475
21520
|
}
|
|
21476
21521
|
else {
|
|
21477
|
-
context.onError(createDOMCompilerError(
|
|
21522
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
21478
21523
|
}
|
|
21479
21524
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
21480
21525
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -21598,7 +21643,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
21598
21643
|
const transformShow = (dir, node, context) => {
|
|
21599
21644
|
const { exp, loc } = dir;
|
|
21600
21645
|
if (!exp) {
|
|
21601
|
-
context.onError(createDOMCompilerError(
|
|
21646
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
21602
21647
|
}
|
|
21603
21648
|
return {
|
|
21604
21649
|
props: [],
|
|
@@ -21617,7 +21662,7 @@ const transformTransition = (node, context) => {
|
|
|
21617
21662
|
}
|
|
21618
21663
|
// warn multiple transition children
|
|
21619
21664
|
if (hasMultipleChildren(node)) {
|
|
21620
|
-
context.onError(createDOMCompilerError(
|
|
21665
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
21621
21666
|
start: node.children[0].loc.start,
|
|
21622
21667
|
end: node.children[node.children.length - 1].loc.end,
|
|
21623
21668
|
source: ''
|
|
@@ -21952,7 +21997,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
21952
21997
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
21953
21998
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
21954
21999
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
21955
|
-
context.onError(createDOMCompilerError(
|
|
22000
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
21956
22001
|
context.removeNode();
|
|
21957
22002
|
}
|
|
21958
22003
|
};
|