vue 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.esm-browser.js +162 -111
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.global.js +162 -111
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +118 -74
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +118 -74
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +6 -6
package/dist/vue.esm-browser.js
CHANGED
|
@@ -2098,12 +2098,6 @@ function reload(id, newComp) {
|
|
|
2098
2098
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
2099
2099
|
// don't end up forcing the same parent to re-render multiple times.
|
|
2100
2100
|
queueJob(instance.parent.update);
|
|
2101
|
-
// instance is the inner component of an async custom element
|
|
2102
|
-
// invoke to reset styles
|
|
2103
|
-
if (instance.parent.type.__asyncLoader &&
|
|
2104
|
-
instance.parent.ceReload) {
|
|
2105
|
-
instance.parent.ceReload(newComp.styles);
|
|
2106
|
-
}
|
|
2107
2101
|
}
|
|
2108
2102
|
else if (instance.appContext.reload) {
|
|
2109
2103
|
// root instance mounted via createApp() has a reload method
|
|
@@ -3952,10 +3946,15 @@ function defineAsyncComponent(source) {
|
|
|
3952
3946
|
}
|
|
3953
3947
|
});
|
|
3954
3948
|
}
|
|
3955
|
-
function createInnerComp(comp,
|
|
3949
|
+
function createInnerComp(comp, parent) {
|
|
3950
|
+
const { ref, props, children, ce } = parent.vnode;
|
|
3956
3951
|
const vnode = createVNode(comp, props, children);
|
|
3957
3952
|
// ensure inner component inherits the async wrapper's ref owner
|
|
3958
3953
|
vnode.ref = ref;
|
|
3954
|
+
// pass the custom element callback on to the inner comp
|
|
3955
|
+
// and remove it from the async wrapper
|
|
3956
|
+
vnode.ce = ce;
|
|
3957
|
+
delete parent.vnode.ce;
|
|
3959
3958
|
return vnode;
|
|
3960
3959
|
}
|
|
3961
3960
|
|
|
@@ -4113,8 +4112,7 @@ const KeepAliveImpl = {
|
|
|
4113
4112
|
: comp);
|
|
4114
4113
|
const { include, exclude, max } = props;
|
|
4115
4114
|
if ((include && (!name || !matches(include, name))) ||
|
|
4116
|
-
(exclude && name && matches(exclude, name))
|
|
4117
|
-
(hmrDirtyComponents.has(comp))) {
|
|
4115
|
+
(exclude && name && matches(exclude, name))) {
|
|
4118
4116
|
current = vnode;
|
|
4119
4117
|
return rawVNode;
|
|
4120
4118
|
}
|
|
@@ -4224,14 +4222,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
4224
4222
|
}, target);
|
|
4225
4223
|
}
|
|
4226
4224
|
function resetShapeFlag(vnode) {
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
}
|
|
4231
|
-
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
|
|
4232
|
-
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4233
|
-
}
|
|
4234
|
-
vnode.shapeFlag = shapeFlag;
|
|
4225
|
+
// bitwise operations to remove keep alive flags
|
|
4226
|
+
vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
4227
|
+
vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
4235
4228
|
}
|
|
4236
4229
|
function getInnerChild(vnode) {
|
|
4237
4230
|
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
|
|
@@ -4530,7 +4523,9 @@ fallback, noSlotted) {
|
|
|
4530
4523
|
(currentRenderingInstance.parent &&
|
|
4531
4524
|
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
4532
4525
|
currentRenderingInstance.parent.isCE)) {
|
|
4533
|
-
|
|
4526
|
+
if (name !== 'default')
|
|
4527
|
+
props.name = name;
|
|
4528
|
+
return createVNode('slot', props, fallback && fallback());
|
|
4534
4529
|
}
|
|
4535
4530
|
let slot = slots[name];
|
|
4536
4531
|
if (slot && slot.length > 1) {
|
|
@@ -4630,6 +4625,7 @@ const publicPropertiesMap =
|
|
|
4630
4625
|
$watch: i => (instanceWatch.bind(i) )
|
|
4631
4626
|
});
|
|
4632
4627
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
4628
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
4633
4629
|
const PublicInstanceProxyHandlers = {
|
|
4634
4630
|
get({ _: instance }, key) {
|
|
4635
4631
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -4637,15 +4633,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
4637
4633
|
if (key === '__isVue') {
|
|
4638
4634
|
return true;
|
|
4639
4635
|
}
|
|
4640
|
-
// prioritize <script setup> bindings during dev.
|
|
4641
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
4642
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
4643
|
-
// indeed has access to all declared variables.
|
|
4644
|
-
if (setupState !== EMPTY_OBJ &&
|
|
4645
|
-
setupState.__isScriptSetup &&
|
|
4646
|
-
hasOwn(setupState, key)) {
|
|
4647
|
-
return setupState[key];
|
|
4648
|
-
}
|
|
4649
4636
|
// data / props / ctx
|
|
4650
4637
|
// This getter gets called for every property access on the render context
|
|
4651
4638
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -4668,7 +4655,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4668
4655
|
// default: just fallthrough
|
|
4669
4656
|
}
|
|
4670
4657
|
}
|
|
4671
|
-
else if (
|
|
4658
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
4672
4659
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
4673
4660
|
return setupState[key];
|
|
4674
4661
|
}
|
|
@@ -4738,21 +4725,26 @@ const PublicInstanceProxyHandlers = {
|
|
|
4738
4725
|
},
|
|
4739
4726
|
set({ _: instance }, key, value) {
|
|
4740
4727
|
const { data, setupState, ctx } = instance;
|
|
4741
|
-
if (
|
|
4728
|
+
if (hasSetupBinding(setupState, key)) {
|
|
4742
4729
|
setupState[key] = value;
|
|
4743
4730
|
return true;
|
|
4744
4731
|
}
|
|
4732
|
+
else if (setupState.__isScriptSetup &&
|
|
4733
|
+
hasOwn(setupState, key)) {
|
|
4734
|
+
warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
4735
|
+
return false;
|
|
4736
|
+
}
|
|
4745
4737
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
4746
4738
|
data[key] = value;
|
|
4747
4739
|
return true;
|
|
4748
4740
|
}
|
|
4749
4741
|
else if (hasOwn(instance.props, key)) {
|
|
4750
|
-
warn$1(`Attempting to mutate prop "${key}". Props are readonly
|
|
4742
|
+
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
4751
4743
|
return false;
|
|
4752
4744
|
}
|
|
4753
4745
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
4754
4746
|
warn$1(`Attempting to mutate public property "${key}". ` +
|
|
4755
|
-
`Properties starting with $ are reserved and readonly
|
|
4747
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
4756
4748
|
return false;
|
|
4757
4749
|
}
|
|
4758
4750
|
else {
|
|
@@ -4773,7 +4765,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4773
4765
|
let normalizedProps;
|
|
4774
4766
|
return (!!accessCache[key] ||
|
|
4775
4767
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
4776
|
-
(setupState
|
|
4768
|
+
hasSetupBinding(setupState, key) ||
|
|
4777
4769
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
4778
4770
|
hasOwn(ctx, key) ||
|
|
4779
4771
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -7812,6 +7804,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7812
7804
|
if (!shallow)
|
|
7813
7805
|
traverseStaticChildren(c1, c2);
|
|
7814
7806
|
}
|
|
7807
|
+
// #6852 also inherit for text nodes
|
|
7808
|
+
if (c2.type === Text) {
|
|
7809
|
+
c2.el = c1.el;
|
|
7810
|
+
}
|
|
7815
7811
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
7816
7812
|
// would have received .el during block patch)
|
|
7817
7813
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -7982,6 +7978,7 @@ const TeleportImpl = {
|
|
|
7982
7978
|
}
|
|
7983
7979
|
}
|
|
7984
7980
|
}
|
|
7981
|
+
updateCssVars(n2);
|
|
7985
7982
|
},
|
|
7986
7983
|
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
7987
7984
|
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
|
|
@@ -8060,11 +8057,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
8060
8057
|
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
8061
8058
|
}
|
|
8062
8059
|
}
|
|
8060
|
+
updateCssVars(vnode);
|
|
8063
8061
|
}
|
|
8064
8062
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
8065
8063
|
}
|
|
8066
8064
|
// Force-casted public typing for h and TSX props inference
|
|
8067
8065
|
const Teleport = TeleportImpl;
|
|
8066
|
+
function updateCssVars(vnode) {
|
|
8067
|
+
// presence of .ut method indicates owner component uses css vars.
|
|
8068
|
+
// code path here can assume browser environment.
|
|
8069
|
+
const ctx = vnode.ctx;
|
|
8070
|
+
if (ctx && ctx.ut) {
|
|
8071
|
+
let node = vnode.children[0].el;
|
|
8072
|
+
while (node !== vnode.targetAnchor) {
|
|
8073
|
+
if (node.nodeType === 1)
|
|
8074
|
+
node.setAttribute('data-v-owner', ctx.uid);
|
|
8075
|
+
node = node.nextSibling;
|
|
8076
|
+
}
|
|
8077
|
+
ctx.ut();
|
|
8078
|
+
}
|
|
8079
|
+
}
|
|
8068
8080
|
|
|
8069
8081
|
const Fragment = Symbol('Fragment' );
|
|
8070
8082
|
const Text = Symbol('Text' );
|
|
@@ -8159,6 +8171,10 @@ function isVNode(value) {
|
|
|
8159
8171
|
function isSameVNodeType(n1, n2) {
|
|
8160
8172
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
8161
8173
|
hmrDirtyComponents.has(n2.type)) {
|
|
8174
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
8175
|
+
// bitwise operations to remove keep alive flags
|
|
8176
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
8177
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
8162
8178
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
8163
8179
|
return false;
|
|
8164
8180
|
}
|
|
@@ -8214,7 +8230,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
8214
8230
|
patchFlag,
|
|
8215
8231
|
dynamicProps,
|
|
8216
8232
|
dynamicChildren: null,
|
|
8217
|
-
appContext: null
|
|
8233
|
+
appContext: null,
|
|
8234
|
+
ctx: currentRenderingInstance
|
|
8218
8235
|
};
|
|
8219
8236
|
if (needFullChildrenNormalization) {
|
|
8220
8237
|
normalizeChildren(vnode, children);
|
|
@@ -8381,7 +8398,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
8381
8398
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
8382
8399
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
8383
8400
|
el: vnode.el,
|
|
8384
|
-
anchor: vnode.anchor
|
|
8401
|
+
anchor: vnode.anchor,
|
|
8402
|
+
ctx: vnode.ctx
|
|
8385
8403
|
};
|
|
8386
8404
|
return cloned;
|
|
8387
8405
|
}
|
|
@@ -9350,7 +9368,7 @@ function isMemoSame(cached, memo) {
|
|
|
9350
9368
|
}
|
|
9351
9369
|
|
|
9352
9370
|
// Core API ------------------------------------------------------------------
|
|
9353
|
-
const version = "3.2.
|
|
9371
|
+
const version = "3.2.45";
|
|
9354
9372
|
/**
|
|
9355
9373
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
9356
9374
|
* @internal
|
|
@@ -9839,12 +9857,21 @@ class VueElement extends BaseClass {
|
|
|
9839
9857
|
`defined as hydratable. Use \`defineSSRCustomElement\`.`);
|
|
9840
9858
|
}
|
|
9841
9859
|
this.attachShadow({ mode: 'open' });
|
|
9860
|
+
if (!this._def.__asyncLoader) {
|
|
9861
|
+
// for sync component defs we can immediately resolve props
|
|
9862
|
+
this._resolveProps(this._def);
|
|
9863
|
+
}
|
|
9842
9864
|
}
|
|
9843
9865
|
}
|
|
9844
9866
|
connectedCallback() {
|
|
9845
9867
|
this._connected = true;
|
|
9846
9868
|
if (!this._instance) {
|
|
9847
|
-
this.
|
|
9869
|
+
if (this._resolved) {
|
|
9870
|
+
this._update();
|
|
9871
|
+
}
|
|
9872
|
+
else {
|
|
9873
|
+
this._resolveDef();
|
|
9874
|
+
}
|
|
9848
9875
|
}
|
|
9849
9876
|
}
|
|
9850
9877
|
disconnectedCallback() {
|
|
@@ -9860,9 +9887,6 @@ class VueElement extends BaseClass {
|
|
|
9860
9887
|
* resolve inner component definition (handle possible async component)
|
|
9861
9888
|
*/
|
|
9862
9889
|
_resolveDef() {
|
|
9863
|
-
if (this._resolved) {
|
|
9864
|
-
return;
|
|
9865
|
-
}
|
|
9866
9890
|
this._resolved = true;
|
|
9867
9891
|
// set initial attrs
|
|
9868
9892
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
@@ -9874,38 +9898,26 @@ class VueElement extends BaseClass {
|
|
|
9874
9898
|
this._setAttr(m.attributeName);
|
|
9875
9899
|
}
|
|
9876
9900
|
}).observe(this, { attributes: true });
|
|
9877
|
-
const resolve = (def) => {
|
|
9878
|
-
const { props
|
|
9879
|
-
const hasOptions = !isArray(props);
|
|
9880
|
-
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
9901
|
+
const resolve = (def, isAsync = false) => {
|
|
9902
|
+
const { props, styles } = def;
|
|
9881
9903
|
// cast Number-type props set before resolve
|
|
9882
9904
|
let numberProps;
|
|
9883
|
-
if (
|
|
9884
|
-
for (const key in
|
|
9905
|
+
if (props && !isArray(props)) {
|
|
9906
|
+
for (const key in props) {
|
|
9885
9907
|
const opt = props[key];
|
|
9886
9908
|
if (opt === Number || (opt && opt.type === Number)) {
|
|
9887
|
-
|
|
9888
|
-
|
|
9909
|
+
if (key in this._props) {
|
|
9910
|
+
this._props[key] = toNumber(this._props[key]);
|
|
9911
|
+
}
|
|
9912
|
+
(numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
|
|
9889
9913
|
}
|
|
9890
9914
|
}
|
|
9891
9915
|
}
|
|
9892
9916
|
this._numberProps = numberProps;
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
}
|
|
9898
|
-
}
|
|
9899
|
-
// defining getter/setters on prototype
|
|
9900
|
-
for (const key of rawKeys.map(camelize)) {
|
|
9901
|
-
Object.defineProperty(this, key, {
|
|
9902
|
-
get() {
|
|
9903
|
-
return this._getProp(key);
|
|
9904
|
-
},
|
|
9905
|
-
set(val) {
|
|
9906
|
-
this._setProp(key, val);
|
|
9907
|
-
}
|
|
9908
|
-
});
|
|
9917
|
+
if (isAsync) {
|
|
9918
|
+
// defining getter/setters on prototype
|
|
9919
|
+
// for sync defs, this already happened in the constructor
|
|
9920
|
+
this._resolveProps(def);
|
|
9909
9921
|
}
|
|
9910
9922
|
// apply CSS
|
|
9911
9923
|
this._applyStyles(styles);
|
|
@@ -9914,12 +9926,33 @@ class VueElement extends BaseClass {
|
|
|
9914
9926
|
};
|
|
9915
9927
|
const asyncDef = this._def.__asyncLoader;
|
|
9916
9928
|
if (asyncDef) {
|
|
9917
|
-
asyncDef().then(resolve);
|
|
9929
|
+
asyncDef().then(def => resolve(def, true));
|
|
9918
9930
|
}
|
|
9919
9931
|
else {
|
|
9920
9932
|
resolve(this._def);
|
|
9921
9933
|
}
|
|
9922
9934
|
}
|
|
9935
|
+
_resolveProps(def) {
|
|
9936
|
+
const { props } = def;
|
|
9937
|
+
const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
|
|
9938
|
+
// check if there are props set pre-upgrade or connect
|
|
9939
|
+
for (const key of Object.keys(this)) {
|
|
9940
|
+
if (key[0] !== '_' && declaredPropKeys.includes(key)) {
|
|
9941
|
+
this._setProp(key, this[key], true, false);
|
|
9942
|
+
}
|
|
9943
|
+
}
|
|
9944
|
+
// defining getter/setters on prototype
|
|
9945
|
+
for (const key of declaredPropKeys.map(camelize)) {
|
|
9946
|
+
Object.defineProperty(this, key, {
|
|
9947
|
+
get() {
|
|
9948
|
+
return this._getProp(key);
|
|
9949
|
+
},
|
|
9950
|
+
set(val) {
|
|
9951
|
+
this._setProp(key, val);
|
|
9952
|
+
}
|
|
9953
|
+
});
|
|
9954
|
+
}
|
|
9955
|
+
}
|
|
9923
9956
|
_setAttr(key) {
|
|
9924
9957
|
let value = this.getAttribute(key);
|
|
9925
9958
|
const camelKey = camelize(key);
|
|
@@ -9975,27 +10008,31 @@ class VueElement extends BaseClass {
|
|
|
9975
10008
|
this._styles.length = 0;
|
|
9976
10009
|
}
|
|
9977
10010
|
this._applyStyles(newStyles);
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
if (!this._def.__asyncLoader) {
|
|
9981
|
-
// reload
|
|
9982
|
-
this._instance = null;
|
|
9983
|
-
this._update();
|
|
9984
|
-
}
|
|
10011
|
+
this._instance = null;
|
|
10012
|
+
this._update();
|
|
9985
10013
|
};
|
|
9986
10014
|
}
|
|
9987
|
-
|
|
9988
|
-
instance.emit = (event, ...args) => {
|
|
10015
|
+
const dispatch = (event, args) => {
|
|
9989
10016
|
this.dispatchEvent(new CustomEvent(event, {
|
|
9990
10017
|
detail: args
|
|
9991
10018
|
}));
|
|
9992
10019
|
};
|
|
10020
|
+
// intercept emit
|
|
10021
|
+
instance.emit = (event, ...args) => {
|
|
10022
|
+
// dispatch both the raw and hyphenated versions of an event
|
|
10023
|
+
// to match Vue behavior
|
|
10024
|
+
dispatch(event, args);
|
|
10025
|
+
if (hyphenate(event) !== event) {
|
|
10026
|
+
dispatch(hyphenate(event), args);
|
|
10027
|
+
}
|
|
10028
|
+
};
|
|
9993
10029
|
// locate nearest Vue custom element parent for provide/inject
|
|
9994
10030
|
let parent = this;
|
|
9995
10031
|
while ((parent =
|
|
9996
10032
|
parent && (parent.parentNode || parent.host))) {
|
|
9997
10033
|
if (parent instanceof VueElement) {
|
|
9998
10034
|
instance.parent = parent._instance;
|
|
10035
|
+
instance.provides = parent._instance.provides;
|
|
9999
10036
|
break;
|
|
10000
10037
|
}
|
|
10001
10038
|
}
|
|
@@ -10051,7 +10088,14 @@ function useCssVars(getter) {
|
|
|
10051
10088
|
warn$1(`useCssVars is called without current active component instance.`);
|
|
10052
10089
|
return;
|
|
10053
10090
|
}
|
|
10054
|
-
const
|
|
10091
|
+
const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
|
|
10092
|
+
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
|
|
10093
|
+
});
|
|
10094
|
+
const setVars = () => {
|
|
10095
|
+
const vars = getter(instance.proxy);
|
|
10096
|
+
setVarsOnVNode(instance.subTree, vars);
|
|
10097
|
+
updateTeleports(vars);
|
|
10098
|
+
};
|
|
10055
10099
|
watchPostEffect(setVars);
|
|
10056
10100
|
onMounted(() => {
|
|
10057
10101
|
const ob = new MutationObserver(setVars);
|
|
@@ -11200,15 +11244,16 @@ const errorMessages = {
|
|
|
11200
11244
|
[41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
|
|
11201
11245
|
[42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
|
|
11202
11246
|
[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.`,
|
|
11203
|
-
[44 /* ErrorCodes.
|
|
11204
|
-
[45 /* ErrorCodes.
|
|
11247
|
+
[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.`,
|
|
11248
|
+
[45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
|
|
11249
|
+
[46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
|
|
11205
11250
|
// generic errors
|
|
11206
|
-
[
|
|
11207
|
-
[
|
|
11208
|
-
[
|
|
11209
|
-
[
|
|
11251
|
+
[47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
11252
|
+
[48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
|
|
11253
|
+
[49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
11254
|
+
[50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
|
|
11210
11255
|
// just to fulfill types
|
|
11211
|
-
[
|
|
11256
|
+
[51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
|
|
11212
11257
|
};
|
|
11213
11258
|
|
|
11214
11259
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -13761,7 +13806,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
13761
13806
|
if (keywordMatch) {
|
|
13762
13807
|
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
|
13763
13808
|
}
|
|
13764
|
-
context.onError(createCompilerError(
|
|
13809
|
+
context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
|
|
13765
13810
|
}
|
|
13766
13811
|
}
|
|
13767
13812
|
|
|
@@ -14552,7 +14597,7 @@ const transformElement = (node, context) => {
|
|
|
14552
14597
|
// 2. Force keep-alive to always be updated, since it uses raw children.
|
|
14553
14598
|
patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
|
|
14554
14599
|
if (node.children.length > 1) {
|
|
14555
|
-
context.onError(createCompilerError(
|
|
14600
|
+
context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
|
|
14556
14601
|
start: node.children[0].loc.start,
|
|
14557
14602
|
end: node.children[node.children.length - 1].loc.end,
|
|
14558
14603
|
source: ''
|
|
@@ -15378,8 +15423,14 @@ const transformModel = (dir, node, context) => {
|
|
|
15378
15423
|
const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
|
|
15379
15424
|
// im SFC <script setup> inline mode, the exp may have been transformed into
|
|
15380
15425
|
// _unref(exp)
|
|
15381
|
-
context.bindingMetadata[rawExp];
|
|
15382
|
-
|
|
15426
|
+
const bindingType = context.bindingMetadata[rawExp];
|
|
15427
|
+
// check props
|
|
15428
|
+
if (bindingType === "props" /* BindingTypes.PROPS */ ||
|
|
15429
|
+
bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
|
|
15430
|
+
context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
|
|
15431
|
+
return createTransformProps();
|
|
15432
|
+
}
|
|
15433
|
+
const maybeRef = !true ;
|
|
15383
15434
|
if (!expString.trim() ||
|
|
15384
15435
|
(!isMemberExpression(expString) && !maybeRef)) {
|
|
15385
15436
|
context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
|
|
@@ -15481,18 +15532,18 @@ function baseCompile(template, options = {}) {
|
|
|
15481
15532
|
/* istanbul ignore if */
|
|
15482
15533
|
{
|
|
15483
15534
|
if (options.prefixIdentifiers === true) {
|
|
15484
|
-
onError(createCompilerError(
|
|
15535
|
+
onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
|
|
15485
15536
|
}
|
|
15486
15537
|
else if (isModuleMode) {
|
|
15487
|
-
onError(createCompilerError(
|
|
15538
|
+
onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
|
|
15488
15539
|
}
|
|
15489
15540
|
}
|
|
15490
15541
|
const prefixIdentifiers = !true ;
|
|
15491
15542
|
if (options.cacheHandlers) {
|
|
15492
|
-
onError(createCompilerError(
|
|
15543
|
+
onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
|
|
15493
15544
|
}
|
|
15494
15545
|
if (options.scopeId && !isModuleMode) {
|
|
15495
|
-
onError(createCompilerError(
|
|
15546
|
+
onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
|
|
15496
15547
|
}
|
|
15497
15548
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
15498
15549
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -15650,26 +15701,26 @@ function createDOMCompilerError(code, loc) {
|
|
|
15650
15701
|
return createCompilerError(code, loc, DOMErrorMessages );
|
|
15651
15702
|
}
|
|
15652
15703
|
const DOMErrorMessages = {
|
|
15653
|
-
[
|
|
15654
|
-
[
|
|
15655
|
-
[
|
|
15656
|
-
[
|
|
15657
|
-
[
|
|
15658
|
-
[
|
|
15659
|
-
[
|
|
15660
|
-
[
|
|
15661
|
-
[
|
|
15662
|
-
[
|
|
15663
|
-
[
|
|
15704
|
+
[51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
|
|
15705
|
+
[52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
|
|
15706
|
+
[53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
|
|
15707
|
+
[54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
|
|
15708
|
+
[55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
15709
|
+
[56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
|
|
15710
|
+
[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.`,
|
|
15711
|
+
[58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
15712
|
+
[59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
|
|
15713
|
+
[60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
|
|
15714
|
+
[61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
15664
15715
|
};
|
|
15665
15716
|
|
|
15666
15717
|
const transformVHtml = (dir, node, context) => {
|
|
15667
15718
|
const { exp, loc } = dir;
|
|
15668
15719
|
if (!exp) {
|
|
15669
|
-
context.onError(createDOMCompilerError(
|
|
15720
|
+
context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
|
|
15670
15721
|
}
|
|
15671
15722
|
if (node.children.length) {
|
|
15672
|
-
context.onError(createDOMCompilerError(
|
|
15723
|
+
context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
|
|
15673
15724
|
node.children.length = 0;
|
|
15674
15725
|
}
|
|
15675
15726
|
return {
|
|
@@ -15682,10 +15733,10 @@ const transformVHtml = (dir, node, context) => {
|
|
|
15682
15733
|
const transformVText = (dir, node, context) => {
|
|
15683
15734
|
const { exp, loc } = dir;
|
|
15684
15735
|
if (!exp) {
|
|
15685
|
-
context.onError(createDOMCompilerError(
|
|
15736
|
+
context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
|
|
15686
15737
|
}
|
|
15687
15738
|
if (node.children.length) {
|
|
15688
|
-
context.onError(createDOMCompilerError(
|
|
15739
|
+
context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
|
|
15689
15740
|
node.children.length = 0;
|
|
15690
15741
|
}
|
|
15691
15742
|
return {
|
|
@@ -15706,12 +15757,12 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15706
15757
|
return baseResult;
|
|
15707
15758
|
}
|
|
15708
15759
|
if (dir.arg) {
|
|
15709
|
-
context.onError(createDOMCompilerError(
|
|
15760
|
+
context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
|
|
15710
15761
|
}
|
|
15711
15762
|
function checkDuplicatedValue() {
|
|
15712
15763
|
const value = findProp(node, 'value');
|
|
15713
15764
|
if (value) {
|
|
15714
|
-
context.onError(createDOMCompilerError(
|
|
15765
|
+
context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
|
|
15715
15766
|
}
|
|
15716
15767
|
}
|
|
15717
15768
|
const { tag } = node;
|
|
@@ -15739,7 +15790,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15739
15790
|
break;
|
|
15740
15791
|
case 'file':
|
|
15741
15792
|
isInvalidType = true;
|
|
15742
|
-
context.onError(createDOMCompilerError(
|
|
15793
|
+
context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
|
|
15743
15794
|
break;
|
|
15744
15795
|
default:
|
|
15745
15796
|
// text type
|
|
@@ -15773,7 +15824,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15773
15824
|
}
|
|
15774
15825
|
}
|
|
15775
15826
|
else {
|
|
15776
|
-
context.onError(createDOMCompilerError(
|
|
15827
|
+
context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
|
|
15777
15828
|
}
|
|
15778
15829
|
// native vmodel doesn't need the `modelValue` props since they are also
|
|
15779
15830
|
// passed to the runtime as `binding.value`. removing it reduces code size.
|
|
@@ -15893,7 +15944,7 @@ const transformOn$1 = (dir, node, context) => {
|
|
|
15893
15944
|
const transformShow = (dir, node, context) => {
|
|
15894
15945
|
const { exp, loc } = dir;
|
|
15895
15946
|
if (!exp) {
|
|
15896
|
-
context.onError(createDOMCompilerError(
|
|
15947
|
+
context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
|
|
15897
15948
|
}
|
|
15898
15949
|
return {
|
|
15899
15950
|
props: [],
|
|
@@ -15912,7 +15963,7 @@ const transformTransition = (node, context) => {
|
|
|
15912
15963
|
}
|
|
15913
15964
|
// warn multiple transition children
|
|
15914
15965
|
if (hasMultipleChildren(node)) {
|
|
15915
|
-
context.onError(createDOMCompilerError(
|
|
15966
|
+
context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
|
|
15916
15967
|
start: node.children[0].loc.start,
|
|
15917
15968
|
end: node.children[node.children.length - 1].loc.end,
|
|
15918
15969
|
source: ''
|
|
@@ -15951,7 +16002,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
15951
16002
|
if (node.type === 1 /* NodeTypes.ELEMENT */ &&
|
|
15952
16003
|
node.tagType === 0 /* ElementTypes.ELEMENT */ &&
|
|
15953
16004
|
(node.tag === 'script' || node.tag === 'style')) {
|
|
15954
|
-
context.onError(createDOMCompilerError(
|
|
16005
|
+
context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
|
|
15955
16006
|
context.removeNode();
|
|
15956
16007
|
}
|
|
15957
16008
|
};
|