@vue/runtime-dom 3.4.0-rc.2 → 3.4.0
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.
|
@@ -1661,7 +1661,7 @@ const ErrorTypeStrings$1 = {
|
|
|
1661
1661
|
[11]: "app warnHandler",
|
|
1662
1662
|
[12]: "ref function",
|
|
1663
1663
|
[13]: "async component loader",
|
|
1664
|
-
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://
|
|
1664
|
+
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
|
|
1665
1665
|
};
|
|
1666
1666
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1667
1667
|
let res;
|
|
@@ -2171,7 +2171,9 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2171
2171
|
`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
|
|
2172
2172
|
instance,
|
|
2173
2173
|
instance.type
|
|
2174
|
-
)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
|
|
2174
|
+
)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
|
|
2175
|
+
event
|
|
2176
|
+
)}" instead of "${event}".`
|
|
2175
2177
|
);
|
|
2176
2178
|
}
|
|
2177
2179
|
}
|
|
@@ -2614,7 +2616,6 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2614
2616
|
const selfName = getComponentName(
|
|
2615
2617
|
Component,
|
|
2616
2618
|
false
|
|
2617
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
2618
2619
|
);
|
|
2619
2620
|
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
2620
2621
|
return Component;
|
|
@@ -3144,6 +3145,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
3144
3145
|
parentSuspense,
|
|
3145
3146
|
parentComponent,
|
|
3146
3147
|
node.parentNode,
|
|
3148
|
+
// eslint-disable-next-line no-restricted-globals
|
|
3147
3149
|
document.createElement("div"),
|
|
3148
3150
|
null,
|
|
3149
3151
|
namespace,
|
|
@@ -3151,7 +3153,6 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace
|
|
|
3151
3153
|
optimized,
|
|
3152
3154
|
rendererInternals,
|
|
3153
3155
|
true
|
|
3154
|
-
/* hydrating */
|
|
3155
3156
|
);
|
|
3156
3157
|
const result = hydrateNode(
|
|
3157
3158
|
node,
|
|
@@ -3253,7 +3254,14 @@ function watch(source, cb, options) {
|
|
|
3253
3254
|
}
|
|
3254
3255
|
return doWatch(source, cb, options);
|
|
3255
3256
|
}
|
|
3256
|
-
function doWatch(source, cb, {
|
|
3257
|
+
function doWatch(source, cb, {
|
|
3258
|
+
immediate,
|
|
3259
|
+
deep,
|
|
3260
|
+
flush,
|
|
3261
|
+
once,
|
|
3262
|
+
onTrack,
|
|
3263
|
+
onTrigger
|
|
3264
|
+
} = EMPTY_OBJ) {
|
|
3257
3265
|
var _a;
|
|
3258
3266
|
if (cb && once) {
|
|
3259
3267
|
const _cb = cb;
|
|
@@ -3938,7 +3946,6 @@ function defineAsyncComponent(source) {
|
|
|
3938
3946
|
instance,
|
|
3939
3947
|
13,
|
|
3940
3948
|
!errorComponent
|
|
3941
|
-
/* do not throw in dev if user provided error component */
|
|
3942
3949
|
);
|
|
3943
3950
|
};
|
|
3944
3951
|
if (suspensible && instance.suspense || false) {
|
|
@@ -4710,7 +4717,7 @@ function useSlots() {
|
|
|
4710
4717
|
function useAttrs() {
|
|
4711
4718
|
return getContext().attrs;
|
|
4712
4719
|
}
|
|
4713
|
-
function useModel(props, name) {
|
|
4720
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
4714
4721
|
const i = getCurrentInstance();
|
|
4715
4722
|
if (!i) {
|
|
4716
4723
|
warn$1(`useModel() called without active instance.`);
|
|
@@ -4720,7 +4727,7 @@ function useModel(props, name) {
|
|
|
4720
4727
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
4721
4728
|
return ref();
|
|
4722
4729
|
}
|
|
4723
|
-
|
|
4730
|
+
const res = customRef((track, trigger) => {
|
|
4724
4731
|
let localValue;
|
|
4725
4732
|
watchSyncEffect(() => {
|
|
4726
4733
|
const propValue = props[name];
|
|
@@ -4732,7 +4739,7 @@ function useModel(props, name) {
|
|
|
4732
4739
|
return {
|
|
4733
4740
|
get() {
|
|
4734
4741
|
track();
|
|
4735
|
-
return localValue;
|
|
4742
|
+
return options.get ? options.get(localValue) : localValue;
|
|
4736
4743
|
},
|
|
4737
4744
|
set(value) {
|
|
4738
4745
|
const rawProps = i.vnode.props;
|
|
@@ -4740,10 +4747,24 @@ function useModel(props, name) {
|
|
|
4740
4747
|
localValue = value;
|
|
4741
4748
|
trigger();
|
|
4742
4749
|
}
|
|
4743
|
-
i.emit(`update:${name}`, value);
|
|
4750
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
4744
4751
|
}
|
|
4745
4752
|
};
|
|
4746
4753
|
});
|
|
4754
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
4755
|
+
res[Symbol.iterator] = () => {
|
|
4756
|
+
let i2 = 0;
|
|
4757
|
+
return {
|
|
4758
|
+
next() {
|
|
4759
|
+
if (i2 < 2) {
|
|
4760
|
+
return { value: i2++ ? props[modifierKey] : res, done: false };
|
|
4761
|
+
} else {
|
|
4762
|
+
return { done: true };
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
};
|
|
4766
|
+
};
|
|
4767
|
+
return res;
|
|
4747
4768
|
}
|
|
4748
4769
|
function getContext() {
|
|
4749
4770
|
const i = getCurrentInstance();
|
|
@@ -5033,7 +5054,6 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
|
|
|
5033
5054
|
opt.from || key,
|
|
5034
5055
|
opt.default,
|
|
5035
5056
|
true
|
|
5036
|
-
/* treat default function as factory */
|
|
5037
5057
|
);
|
|
5038
5058
|
} else {
|
|
5039
5059
|
injected = inject(opt.from || key);
|
|
@@ -5519,7 +5539,6 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
5519
5539
|
value,
|
|
5520
5540
|
instance,
|
|
5521
5541
|
false
|
|
5522
|
-
/* isAbsent */
|
|
5523
5542
|
);
|
|
5524
5543
|
}
|
|
5525
5544
|
} else {
|
|
@@ -5551,7 +5570,6 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
5551
5570
|
void 0,
|
|
5552
5571
|
instance,
|
|
5553
5572
|
true
|
|
5554
|
-
/* isAbsent */
|
|
5555
5573
|
);
|
|
5556
5574
|
}
|
|
5557
5575
|
} else {
|
|
@@ -8417,7 +8435,6 @@ function createElementBlock(type, props, children, patchFlag, dynamicProps, shap
|
|
|
8417
8435
|
dynamicProps,
|
|
8418
8436
|
shapeFlag,
|
|
8419
8437
|
true
|
|
8420
|
-
/* isBlock */
|
|
8421
8438
|
)
|
|
8422
8439
|
);
|
|
8423
8440
|
}
|
|
@@ -8430,7 +8447,6 @@ function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
|
8430
8447
|
patchFlag,
|
|
8431
8448
|
dynamicProps,
|
|
8432
8449
|
true
|
|
8433
|
-
/* isBlock: prevent a block from tracking itself */
|
|
8434
8450
|
)
|
|
8435
8451
|
);
|
|
8436
8452
|
}
|
|
@@ -8922,7 +8938,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8922
8938
|
setup,
|
|
8923
8939
|
instance,
|
|
8924
8940
|
0,
|
|
8925
|
-
[
|
|
8941
|
+
[
|
|
8942
|
+
shallowReadonly(instance.props) ,
|
|
8943
|
+
setupContext
|
|
8944
|
+
]
|
|
8926
8945
|
);
|
|
8927
8946
|
resetTracking();
|
|
8928
8947
|
unsetCurrentInstance();
|
|
@@ -9032,7 +9051,6 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
9032
9051
|
if (!compile && Component.template) {
|
|
9033
9052
|
warn$1(
|
|
9034
9053
|
`Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
|
|
9035
|
-
/* should not happen */
|
|
9036
9054
|
);
|
|
9037
9055
|
} else {
|
|
9038
9056
|
warn$1(`Component is missing template or render function.`);
|
|
@@ -9392,7 +9410,7 @@ function isMemoSame(cached, memo) {
|
|
|
9392
9410
|
return true;
|
|
9393
9411
|
}
|
|
9394
9412
|
|
|
9395
|
-
const version = "3.4.0
|
|
9413
|
+
const version = "3.4.0";
|
|
9396
9414
|
const warn = warn$1 ;
|
|
9397
9415
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9398
9416
|
const devtools = devtools$1 ;
|