@vue/runtime-dom 3.4.8 → 3.4.9
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/runtime-dom.cjs.js +5 -5
- package/dist/runtime-dom.cjs.prod.js +5 -5
- package/dist/runtime-dom.esm-browser.js +80 -66
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +5 -5
- package/dist/runtime-dom.global.js +80 -66
- package/dist/runtime-dom.global.prod.js +5 -5
- package/package.json +17 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.4.
|
|
2
|
+
* @vue/runtime-dom v3.4.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2676,6 +2676,10 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
2676
2676
|
rendererInternals
|
|
2677
2677
|
);
|
|
2678
2678
|
} else {
|
|
2679
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
2680
|
+
n2.suspense = n1.suspense;
|
|
2681
|
+
return;
|
|
2682
|
+
}
|
|
2679
2683
|
patchSuspense(
|
|
2680
2684
|
n1,
|
|
2681
2685
|
n2,
|
|
@@ -4743,58 +4747,6 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
4743
4747
|
function useAttrs() {
|
|
4744
4748
|
return getContext().attrs;
|
|
4745
4749
|
}
|
|
4746
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
4747
|
-
const i = getCurrentInstance();
|
|
4748
|
-
if (!i) {
|
|
4749
|
-
warn$1(`useModel() called without active instance.`);
|
|
4750
|
-
return ref();
|
|
4751
|
-
}
|
|
4752
|
-
if (!i.propsOptions[0][name]) {
|
|
4753
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
4754
|
-
return ref();
|
|
4755
|
-
}
|
|
4756
|
-
const camelizedName = camelize(name);
|
|
4757
|
-
const hyphenatedName = hyphenate(name);
|
|
4758
|
-
const res = customRef((track, trigger) => {
|
|
4759
|
-
let localValue;
|
|
4760
|
-
watchSyncEffect(() => {
|
|
4761
|
-
const propValue = props[name];
|
|
4762
|
-
if (hasChanged(localValue, propValue)) {
|
|
4763
|
-
localValue = propValue;
|
|
4764
|
-
trigger();
|
|
4765
|
-
}
|
|
4766
|
-
});
|
|
4767
|
-
return {
|
|
4768
|
-
get() {
|
|
4769
|
-
track();
|
|
4770
|
-
return options.get ? options.get(localValue) : localValue;
|
|
4771
|
-
},
|
|
4772
|
-
set(value) {
|
|
4773
|
-
const rawProps = i.vnode.props;
|
|
4774
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
4775
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
4776
|
-
localValue = value;
|
|
4777
|
-
trigger();
|
|
4778
|
-
}
|
|
4779
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
4780
|
-
}
|
|
4781
|
-
};
|
|
4782
|
-
});
|
|
4783
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
4784
|
-
res[Symbol.iterator] = () => {
|
|
4785
|
-
let i2 = 0;
|
|
4786
|
-
return {
|
|
4787
|
-
next() {
|
|
4788
|
-
if (i2 < 2) {
|
|
4789
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
4790
|
-
} else {
|
|
4791
|
-
return { done: true };
|
|
4792
|
-
}
|
|
4793
|
-
}
|
|
4794
|
-
};
|
|
4795
|
-
};
|
|
4796
|
-
return res;
|
|
4797
|
-
}
|
|
4798
4750
|
function getContext() {
|
|
4799
4751
|
const i = getCurrentInstance();
|
|
4800
4752
|
if (!i) {
|
|
@@ -6581,8 +6533,17 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
6581
6533
|
actual = el.hasAttribute(key);
|
|
6582
6534
|
expected = includeBooleanAttr(clientValue);
|
|
6583
6535
|
} else {
|
|
6584
|
-
|
|
6585
|
-
|
|
6536
|
+
if (el.hasAttribute(key)) {
|
|
6537
|
+
actual = el.getAttribute(key);
|
|
6538
|
+
} else if (key in el) {
|
|
6539
|
+
const serverValue = el[key];
|
|
6540
|
+
if (!isObject(serverValue)) {
|
|
6541
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
if (!isObject(clientValue)) {
|
|
6545
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
6546
|
+
}
|
|
6586
6547
|
}
|
|
6587
6548
|
if (actual !== expected) {
|
|
6588
6549
|
mismatchType = `attribute`;
|
|
@@ -6591,15 +6552,15 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
6591
6552
|
}
|
|
6592
6553
|
if (mismatchType) {
|
|
6593
6554
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
el,
|
|
6597
|
-
`
|
|
6555
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
6556
|
+
const postSegment = `
|
|
6598
6557
|
- rendered on server: ${format(actual)}
|
|
6599
6558
|
- expected on client: ${format(expected)}
|
|
6600
6559
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
6601
|
-
You should fix the source of the mismatch
|
|
6602
|
-
|
|
6560
|
+
You should fix the source of the mismatch.`;
|
|
6561
|
+
{
|
|
6562
|
+
warn$1(preSegment, el, postSegment);
|
|
6563
|
+
}
|
|
6603
6564
|
return true;
|
|
6604
6565
|
}
|
|
6605
6566
|
return false;
|
|
@@ -9255,6 +9216,59 @@ Component that was made reactive: `,
|
|
|
9255
9216
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
9256
9217
|
};
|
|
9257
9218
|
|
|
9219
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
9220
|
+
const i = getCurrentInstance();
|
|
9221
|
+
if (!i) {
|
|
9222
|
+
warn$1(`useModel() called without active instance.`);
|
|
9223
|
+
return ref();
|
|
9224
|
+
}
|
|
9225
|
+
if (!i.propsOptions[0][name]) {
|
|
9226
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
9227
|
+
return ref();
|
|
9228
|
+
}
|
|
9229
|
+
const camelizedName = camelize(name);
|
|
9230
|
+
const hyphenatedName = hyphenate(name);
|
|
9231
|
+
const res = customRef((track, trigger) => {
|
|
9232
|
+
let localValue;
|
|
9233
|
+
watchSyncEffect(() => {
|
|
9234
|
+
const propValue = props[name];
|
|
9235
|
+
if (hasChanged(localValue, propValue)) {
|
|
9236
|
+
localValue = propValue;
|
|
9237
|
+
trigger();
|
|
9238
|
+
}
|
|
9239
|
+
});
|
|
9240
|
+
return {
|
|
9241
|
+
get() {
|
|
9242
|
+
track();
|
|
9243
|
+
return options.get ? options.get(localValue) : localValue;
|
|
9244
|
+
},
|
|
9245
|
+
set(value) {
|
|
9246
|
+
const rawProps = i.vnode.props;
|
|
9247
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
9248
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
9249
|
+
localValue = value;
|
|
9250
|
+
trigger();
|
|
9251
|
+
}
|
|
9252
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
9253
|
+
}
|
|
9254
|
+
};
|
|
9255
|
+
});
|
|
9256
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
9257
|
+
res[Symbol.iterator] = () => {
|
|
9258
|
+
let i2 = 0;
|
|
9259
|
+
return {
|
|
9260
|
+
next() {
|
|
9261
|
+
if (i2 < 2) {
|
|
9262
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
9263
|
+
} else {
|
|
9264
|
+
return { done: true };
|
|
9265
|
+
}
|
|
9266
|
+
}
|
|
9267
|
+
};
|
|
9268
|
+
};
|
|
9269
|
+
return res;
|
|
9270
|
+
}
|
|
9271
|
+
|
|
9258
9272
|
function h(type, propsOrChildren, children) {
|
|
9259
9273
|
const l = arguments.length;
|
|
9260
9274
|
if (l === 2) {
|
|
@@ -9477,7 +9491,7 @@ Component that was made reactive: `,
|
|
|
9477
9491
|
return true;
|
|
9478
9492
|
}
|
|
9479
9493
|
|
|
9480
|
-
const version = "3.4.
|
|
9494
|
+
const version = "3.4.9";
|
|
9481
9495
|
const warn = warn$1 ;
|
|
9482
9496
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9483
9497
|
const devtools = devtools$1 ;
|
|
@@ -9946,6 +9960,7 @@ Component that was made reactive: `,
|
|
|
9946
9960
|
|
|
9947
9961
|
function patchStyle(el, prev, next) {
|
|
9948
9962
|
const style = el.style;
|
|
9963
|
+
const currentDisplay = style.display;
|
|
9949
9964
|
const isCssString = isString(next);
|
|
9950
9965
|
if (next && !isCssString) {
|
|
9951
9966
|
if (prev && !isString(prev)) {
|
|
@@ -9959,7 +9974,6 @@ Component that was made reactive: `,
|
|
|
9959
9974
|
setStyle(style, key, next[key]);
|
|
9960
9975
|
}
|
|
9961
9976
|
} else {
|
|
9962
|
-
const currentDisplay = style.display;
|
|
9963
9977
|
if (isCssString) {
|
|
9964
9978
|
if (prev !== next) {
|
|
9965
9979
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -9971,9 +9985,9 @@ Component that was made reactive: `,
|
|
|
9971
9985
|
} else if (prev) {
|
|
9972
9986
|
el.removeAttribute("style");
|
|
9973
9987
|
}
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9988
|
+
}
|
|
9989
|
+
if (vShowOldKey in el) {
|
|
9990
|
+
style.display = currentDisplay;
|
|
9977
9991
|
}
|
|
9978
9992
|
}
|
|
9979
9993
|
const semicolonRE = /[^\\];\s*$/;
|