@vue/compat 3.4.7 → 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/vue.cjs.js +105 -78
- package/dist/vue.cjs.prod.js +66 -53
- package/dist/vue.esm-browser.js +105 -78
- package/dist/vue.esm-browser.prod.js +8 -3
- package/dist/vue.esm-bundler.js +107 -80
- package/dist/vue.global.js +105 -78
- package/dist/vue.global.prod.js +8 -3
- package/dist/vue.runtime.esm-browser.js +105 -78
- package/dist/vue.runtime.esm-browser.prod.js +8 -3
- package/dist/vue.runtime.esm-bundler.js +107 -80
- package/dist/vue.runtime.global.js +105 -78
- package/dist/vue.runtime.global.prod.js +8 -3
- package/package.json +16 -2
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vue/compat v3.4.9
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
1
6
|
function makeMap(str, expectsLowerCase) {
|
|
2
7
|
const set = new Set(str.split(","));
|
|
3
8
|
return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
|
|
@@ -3101,8 +3106,6 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3101
3106
|
return false;
|
|
3102
3107
|
}
|
|
3103
3108
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3104
|
-
if (!el)
|
|
3105
|
-
return;
|
|
3106
3109
|
while (parent) {
|
|
3107
3110
|
const root = parent.subTree;
|
|
3108
3111
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
@@ -3198,6 +3201,10 @@ const SuspenseImpl = {
|
|
|
3198
3201
|
rendererInternals
|
|
3199
3202
|
);
|
|
3200
3203
|
} else {
|
|
3204
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
3205
|
+
n2.suspense = n1.suspense;
|
|
3206
|
+
return;
|
|
3207
|
+
}
|
|
3201
3208
|
patchSuspense(
|
|
3202
3209
|
n1,
|
|
3203
3210
|
n2,
|
|
@@ -3747,7 +3754,12 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
3747
3754
|
function setActiveBranch(suspense, branch) {
|
|
3748
3755
|
suspense.activeBranch = branch;
|
|
3749
3756
|
const { vnode, parentComponent } = suspense;
|
|
3750
|
-
|
|
3757
|
+
let el = branch.el;
|
|
3758
|
+
while (!el && branch.component) {
|
|
3759
|
+
branch = branch.component.subTree;
|
|
3760
|
+
el = branch.el;
|
|
3761
|
+
}
|
|
3762
|
+
vnode.el = el;
|
|
3751
3763
|
if (parentComponent && parentComponent.subTree === vnode) {
|
|
3752
3764
|
parentComponent.vnode.el = el;
|
|
3753
3765
|
updateHOCHostEl(parentComponent, el);
|
|
@@ -5868,58 +5880,6 @@ function useSlots() {
|
|
|
5868
5880
|
function useAttrs() {
|
|
5869
5881
|
return getContext().attrs;
|
|
5870
5882
|
}
|
|
5871
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
5872
|
-
const i = getCurrentInstance();
|
|
5873
|
-
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
5874
|
-
warn$1(`useModel() called without active instance.`);
|
|
5875
|
-
return ref();
|
|
5876
|
-
}
|
|
5877
|
-
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
5878
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
5879
|
-
return ref();
|
|
5880
|
-
}
|
|
5881
|
-
const camelizedName = camelize(name);
|
|
5882
|
-
const hyphenatedName = hyphenate(name);
|
|
5883
|
-
const res = customRef((track, trigger) => {
|
|
5884
|
-
let localValue;
|
|
5885
|
-
watchSyncEffect(() => {
|
|
5886
|
-
const propValue = props[name];
|
|
5887
|
-
if (hasChanged(localValue, propValue)) {
|
|
5888
|
-
localValue = propValue;
|
|
5889
|
-
trigger();
|
|
5890
|
-
}
|
|
5891
|
-
});
|
|
5892
|
-
return {
|
|
5893
|
-
get() {
|
|
5894
|
-
track();
|
|
5895
|
-
return options.get ? options.get(localValue) : localValue;
|
|
5896
|
-
},
|
|
5897
|
-
set(value) {
|
|
5898
|
-
const rawProps = i.vnode.props;
|
|
5899
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
5900
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
5901
|
-
localValue = value;
|
|
5902
|
-
trigger();
|
|
5903
|
-
}
|
|
5904
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
5905
|
-
}
|
|
5906
|
-
};
|
|
5907
|
-
});
|
|
5908
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
5909
|
-
res[Symbol.iterator] = () => {
|
|
5910
|
-
let i2 = 0;
|
|
5911
|
-
return {
|
|
5912
|
-
next() {
|
|
5913
|
-
if (i2 < 2) {
|
|
5914
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
5915
|
-
} else {
|
|
5916
|
-
return { done: true };
|
|
5917
|
-
}
|
|
5918
|
-
}
|
|
5919
|
-
};
|
|
5920
|
-
};
|
|
5921
|
-
return res;
|
|
5922
|
-
}
|
|
5923
5883
|
function getContext() {
|
|
5924
5884
|
const i = getCurrentInstance();
|
|
5925
5885
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
@@ -6493,7 +6453,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6493
6453
|
return vm;
|
|
6494
6454
|
}
|
|
6495
6455
|
}
|
|
6496
|
-
Vue.version = `2.6.14-compat:${"3.4.
|
|
6456
|
+
Vue.version = `2.6.14-compat:${"3.4.9"}`;
|
|
6497
6457
|
Vue.config = singletonApp.config;
|
|
6498
6458
|
Vue.use = (p, ...options) => {
|
|
6499
6459
|
if (p && isFunction(p.install)) {
|
|
@@ -8232,29 +8192,43 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
8232
8192
|
let actual;
|
|
8233
8193
|
let expected;
|
|
8234
8194
|
if (key === "class") {
|
|
8235
|
-
actual =
|
|
8236
|
-
expected =
|
|
8237
|
-
if (!isSetEqual(actual, expected)) {
|
|
8195
|
+
actual = el.getAttribute("class");
|
|
8196
|
+
expected = normalizeClass(clientValue);
|
|
8197
|
+
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
8238
8198
|
mismatchType = mismatchKey = `class`;
|
|
8239
8199
|
}
|
|
8240
8200
|
} else if (key === "style") {
|
|
8241
|
-
actual =
|
|
8242
|
-
expected =
|
|
8243
|
-
|
|
8244
|
-
);
|
|
8201
|
+
actual = el.getAttribute("style");
|
|
8202
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
8203
|
+
const actualMap = toStyleMap(actual);
|
|
8204
|
+
const expectedMap = toStyleMap(expected);
|
|
8245
8205
|
if (vnode.dirs) {
|
|
8246
8206
|
for (const { dir, value } of vnode.dirs) {
|
|
8247
8207
|
if (dir.name === "show" && !value) {
|
|
8248
|
-
|
|
8208
|
+
expectedMap.set("display", "none");
|
|
8249
8209
|
}
|
|
8250
8210
|
}
|
|
8251
8211
|
}
|
|
8252
|
-
if (!isMapEqual(
|
|
8212
|
+
if (!isMapEqual(actualMap, expectedMap)) {
|
|
8253
8213
|
mismatchType = mismatchKey = "style";
|
|
8254
8214
|
}
|
|
8255
8215
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
8256
|
-
|
|
8257
|
-
|
|
8216
|
+
if (isBooleanAttr(key)) {
|
|
8217
|
+
actual = el.hasAttribute(key);
|
|
8218
|
+
expected = includeBooleanAttr(clientValue);
|
|
8219
|
+
} else {
|
|
8220
|
+
if (el.hasAttribute(key)) {
|
|
8221
|
+
actual = el.getAttribute(key);
|
|
8222
|
+
} else if (key in el) {
|
|
8223
|
+
const serverValue = el[key];
|
|
8224
|
+
if (!isObject(serverValue)) {
|
|
8225
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8228
|
+
if (!isObject(clientValue)) {
|
|
8229
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8258
8232
|
if (actual !== expected) {
|
|
8259
8233
|
mismatchType = `attribute`;
|
|
8260
8234
|
mismatchKey = key;
|
|
@@ -8262,15 +8236,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
8262
8236
|
}
|
|
8263
8237
|
if (mismatchType) {
|
|
8264
8238
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
el,
|
|
8268
|
-
`
|
|
8239
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
8240
|
+
const postSegment = `
|
|
8269
8241
|
- rendered on server: ${format(actual)}
|
|
8270
8242
|
- expected on client: ${format(expected)}
|
|
8271
8243
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
8272
|
-
You should fix the source of the mismatch
|
|
8273
|
-
|
|
8244
|
+
You should fix the source of the mismatch.`;
|
|
8245
|
+
{
|
|
8246
|
+
warn$1(preSegment, el, postSegment);
|
|
8247
|
+
}
|
|
8274
8248
|
return true;
|
|
8275
8249
|
}
|
|
8276
8250
|
return false;
|
|
@@ -11104,6 +11078,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
11104
11078
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11105
11079
|
};
|
|
11106
11080
|
|
|
11081
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
11082
|
+
const i = getCurrentInstance();
|
|
11083
|
+
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
11084
|
+
warn$1(`useModel() called without active instance.`);
|
|
11085
|
+
return ref();
|
|
11086
|
+
}
|
|
11087
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
11088
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
11089
|
+
return ref();
|
|
11090
|
+
}
|
|
11091
|
+
const camelizedName = camelize(name);
|
|
11092
|
+
const hyphenatedName = hyphenate(name);
|
|
11093
|
+
const res = customRef((track, trigger) => {
|
|
11094
|
+
let localValue;
|
|
11095
|
+
watchSyncEffect(() => {
|
|
11096
|
+
const propValue = props[name];
|
|
11097
|
+
if (hasChanged(localValue, propValue)) {
|
|
11098
|
+
localValue = propValue;
|
|
11099
|
+
trigger();
|
|
11100
|
+
}
|
|
11101
|
+
});
|
|
11102
|
+
return {
|
|
11103
|
+
get() {
|
|
11104
|
+
track();
|
|
11105
|
+
return options.get ? options.get(localValue) : localValue;
|
|
11106
|
+
},
|
|
11107
|
+
set(value) {
|
|
11108
|
+
const rawProps = i.vnode.props;
|
|
11109
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
11110
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
11111
|
+
localValue = value;
|
|
11112
|
+
trigger();
|
|
11113
|
+
}
|
|
11114
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
11115
|
+
}
|
|
11116
|
+
};
|
|
11117
|
+
});
|
|
11118
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
11119
|
+
res[Symbol.iterator] = () => {
|
|
11120
|
+
let i2 = 0;
|
|
11121
|
+
return {
|
|
11122
|
+
next() {
|
|
11123
|
+
if (i2 < 2) {
|
|
11124
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
11125
|
+
} else {
|
|
11126
|
+
return { done: true };
|
|
11127
|
+
}
|
|
11128
|
+
}
|
|
11129
|
+
};
|
|
11130
|
+
};
|
|
11131
|
+
return res;
|
|
11132
|
+
}
|
|
11133
|
+
|
|
11107
11134
|
function h(type, propsOrChildren, children) {
|
|
11108
11135
|
const l = arguments.length;
|
|
11109
11136
|
if (l === 2) {
|
|
@@ -11326,11 +11353,11 @@ function isMemoSame(cached, memo) {
|
|
|
11326
11353
|
return true;
|
|
11327
11354
|
}
|
|
11328
11355
|
|
|
11329
|
-
const version = "3.4.
|
|
11356
|
+
const version = "3.4.9";
|
|
11330
11357
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
11331
11358
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11332
|
-
const devtools = !!(process.env.NODE_ENV !== "production") ||
|
|
11333
|
-
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") ||
|
|
11359
|
+
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
11360
|
+
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
11334
11361
|
const _ssrUtils = {
|
|
11335
11362
|
createComponentInstance,
|
|
11336
11363
|
setupComponent,
|
|
@@ -11854,6 +11881,7 @@ function setVarsOnNode(el, vars) {
|
|
|
11854
11881
|
|
|
11855
11882
|
function patchStyle(el, prev, next) {
|
|
11856
11883
|
const style = el.style;
|
|
11884
|
+
const currentDisplay = style.display;
|
|
11857
11885
|
const isCssString = isString(next);
|
|
11858
11886
|
if (next && !isCssString) {
|
|
11859
11887
|
if (prev && !isString(prev)) {
|
|
@@ -11867,7 +11895,6 @@ function patchStyle(el, prev, next) {
|
|
|
11867
11895
|
setStyle(style, key, next[key]);
|
|
11868
11896
|
}
|
|
11869
11897
|
} else {
|
|
11870
|
-
const currentDisplay = style.display;
|
|
11871
11898
|
if (isCssString) {
|
|
11872
11899
|
if (prev !== next) {
|
|
11873
11900
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -11879,9 +11906,9 @@ function patchStyle(el, prev, next) {
|
|
|
11879
11906
|
} else if (prev) {
|
|
11880
11907
|
el.removeAttribute("style");
|
|
11881
11908
|
}
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11909
|
+
}
|
|
11910
|
+
if (vShowOldKey in el) {
|
|
11911
|
+
style.display = currentDisplay;
|
|
11885
11912
|
}
|
|
11886
11913
|
}
|
|
11887
11914
|
const semicolonRE = /[^\\];\s*$/;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vue/compat v3.4.9
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/
|
|
1
6
|
var Vue = (function () {
|
|
2
7
|
'use strict';
|
|
3
8
|
|
|
@@ -3097,8 +3102,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3097
3102
|
return false;
|
|
3098
3103
|
}
|
|
3099
3104
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3100
|
-
if (!el)
|
|
3101
|
-
return;
|
|
3102
3105
|
while (parent) {
|
|
3103
3106
|
const root = parent.subTree;
|
|
3104
3107
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
@@ -3194,6 +3197,10 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
3194
3197
|
rendererInternals
|
|
3195
3198
|
);
|
|
3196
3199
|
} else {
|
|
3200
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
3201
|
+
n2.suspense = n1.suspense;
|
|
3202
|
+
return;
|
|
3203
|
+
}
|
|
3197
3204
|
patchSuspense(
|
|
3198
3205
|
n1,
|
|
3199
3206
|
n2,
|
|
@@ -3743,7 +3750,12 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
3743
3750
|
function setActiveBranch(suspense, branch) {
|
|
3744
3751
|
suspense.activeBranch = branch;
|
|
3745
3752
|
const { vnode, parentComponent } = suspense;
|
|
3746
|
-
|
|
3753
|
+
let el = branch.el;
|
|
3754
|
+
while (!el && branch.component) {
|
|
3755
|
+
branch = branch.component.subTree;
|
|
3756
|
+
el = branch.el;
|
|
3757
|
+
}
|
|
3758
|
+
vnode.el = el;
|
|
3747
3759
|
if (parentComponent && parentComponent.subTree === vnode) {
|
|
3748
3760
|
parentComponent.vnode.el = el;
|
|
3749
3761
|
updateHOCHostEl(parentComponent, el);
|
|
@@ -5829,58 +5841,6 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5829
5841
|
function useAttrs() {
|
|
5830
5842
|
return getContext().attrs;
|
|
5831
5843
|
}
|
|
5832
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
5833
|
-
const i = getCurrentInstance();
|
|
5834
|
-
if (!i) {
|
|
5835
|
-
warn$1(`useModel() called without active instance.`);
|
|
5836
|
-
return ref();
|
|
5837
|
-
}
|
|
5838
|
-
if (!i.propsOptions[0][name]) {
|
|
5839
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
5840
|
-
return ref();
|
|
5841
|
-
}
|
|
5842
|
-
const camelizedName = camelize(name);
|
|
5843
|
-
const hyphenatedName = hyphenate(name);
|
|
5844
|
-
const res = customRef((track, trigger) => {
|
|
5845
|
-
let localValue;
|
|
5846
|
-
watchSyncEffect(() => {
|
|
5847
|
-
const propValue = props[name];
|
|
5848
|
-
if (hasChanged(localValue, propValue)) {
|
|
5849
|
-
localValue = propValue;
|
|
5850
|
-
trigger();
|
|
5851
|
-
}
|
|
5852
|
-
});
|
|
5853
|
-
return {
|
|
5854
|
-
get() {
|
|
5855
|
-
track();
|
|
5856
|
-
return options.get ? options.get(localValue) : localValue;
|
|
5857
|
-
},
|
|
5858
|
-
set(value) {
|
|
5859
|
-
const rawProps = i.vnode.props;
|
|
5860
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
5861
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
5862
|
-
localValue = value;
|
|
5863
|
-
trigger();
|
|
5864
|
-
}
|
|
5865
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
5866
|
-
}
|
|
5867
|
-
};
|
|
5868
|
-
});
|
|
5869
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
5870
|
-
res[Symbol.iterator] = () => {
|
|
5871
|
-
let i2 = 0;
|
|
5872
|
-
return {
|
|
5873
|
-
next() {
|
|
5874
|
-
if (i2 < 2) {
|
|
5875
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
5876
|
-
} else {
|
|
5877
|
-
return { done: true };
|
|
5878
|
-
}
|
|
5879
|
-
}
|
|
5880
|
-
};
|
|
5881
|
-
};
|
|
5882
|
-
return res;
|
|
5883
|
-
}
|
|
5884
5844
|
function getContext() {
|
|
5885
5845
|
const i = getCurrentInstance();
|
|
5886
5846
|
if (!i) {
|
|
@@ -6452,7 +6412,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6452
6412
|
return vm;
|
|
6453
6413
|
}
|
|
6454
6414
|
}
|
|
6455
|
-
Vue.version = `2.6.14-compat:${"3.4.
|
|
6415
|
+
Vue.version = `2.6.14-compat:${"3.4.9"}`;
|
|
6456
6416
|
Vue.config = singletonApp.config;
|
|
6457
6417
|
Vue.use = (p, ...options) => {
|
|
6458
6418
|
if (p && isFunction(p.install)) {
|
|
@@ -8178,29 +8138,43 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8178
8138
|
let actual;
|
|
8179
8139
|
let expected;
|
|
8180
8140
|
if (key === "class") {
|
|
8181
|
-
actual =
|
|
8182
|
-
expected =
|
|
8183
|
-
if (!isSetEqual(actual, expected)) {
|
|
8141
|
+
actual = el.getAttribute("class");
|
|
8142
|
+
expected = normalizeClass(clientValue);
|
|
8143
|
+
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
8184
8144
|
mismatchType = mismatchKey = `class`;
|
|
8185
8145
|
}
|
|
8186
8146
|
} else if (key === "style") {
|
|
8187
|
-
actual =
|
|
8188
|
-
expected =
|
|
8189
|
-
|
|
8190
|
-
);
|
|
8147
|
+
actual = el.getAttribute("style");
|
|
8148
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
8149
|
+
const actualMap = toStyleMap(actual);
|
|
8150
|
+
const expectedMap = toStyleMap(expected);
|
|
8191
8151
|
if (vnode.dirs) {
|
|
8192
8152
|
for (const { dir, value } of vnode.dirs) {
|
|
8193
8153
|
if (dir.name === "show" && !value) {
|
|
8194
|
-
|
|
8154
|
+
expectedMap.set("display", "none");
|
|
8195
8155
|
}
|
|
8196
8156
|
}
|
|
8197
8157
|
}
|
|
8198
|
-
if (!isMapEqual(
|
|
8158
|
+
if (!isMapEqual(actualMap, expectedMap)) {
|
|
8199
8159
|
mismatchType = mismatchKey = "style";
|
|
8200
8160
|
}
|
|
8201
8161
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
8202
|
-
|
|
8203
|
-
|
|
8162
|
+
if (isBooleanAttr(key)) {
|
|
8163
|
+
actual = el.hasAttribute(key);
|
|
8164
|
+
expected = includeBooleanAttr(clientValue);
|
|
8165
|
+
} else {
|
|
8166
|
+
if (el.hasAttribute(key)) {
|
|
8167
|
+
actual = el.getAttribute(key);
|
|
8168
|
+
} else if (key in el) {
|
|
8169
|
+
const serverValue = el[key];
|
|
8170
|
+
if (!isObject(serverValue)) {
|
|
8171
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
8172
|
+
}
|
|
8173
|
+
}
|
|
8174
|
+
if (!isObject(clientValue)) {
|
|
8175
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8204
8178
|
if (actual !== expected) {
|
|
8205
8179
|
mismatchType = `attribute`;
|
|
8206
8180
|
mismatchKey = key;
|
|
@@ -8208,15 +8182,15 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8208
8182
|
}
|
|
8209
8183
|
if (mismatchType) {
|
|
8210
8184
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
el,
|
|
8214
|
-
`
|
|
8185
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
8186
|
+
const postSegment = `
|
|
8215
8187
|
- rendered on server: ${format(actual)}
|
|
8216
8188
|
- expected on client: ${format(expected)}
|
|
8217
8189
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
8218
|
-
You should fix the source of the mismatch
|
|
8219
|
-
|
|
8190
|
+
You should fix the source of the mismatch.`;
|
|
8191
|
+
{
|
|
8192
|
+
warn$1(preSegment, el, postSegment);
|
|
8193
|
+
}
|
|
8220
8194
|
return true;
|
|
8221
8195
|
}
|
|
8222
8196
|
return false;
|
|
@@ -10979,6 +10953,59 @@ Component that was made reactive: `,
|
|
|
10979
10953
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
10980
10954
|
};
|
|
10981
10955
|
|
|
10956
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
10957
|
+
const i = getCurrentInstance();
|
|
10958
|
+
if (!i) {
|
|
10959
|
+
warn$1(`useModel() called without active instance.`);
|
|
10960
|
+
return ref();
|
|
10961
|
+
}
|
|
10962
|
+
if (!i.propsOptions[0][name]) {
|
|
10963
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
10964
|
+
return ref();
|
|
10965
|
+
}
|
|
10966
|
+
const camelizedName = camelize(name);
|
|
10967
|
+
const hyphenatedName = hyphenate(name);
|
|
10968
|
+
const res = customRef((track, trigger) => {
|
|
10969
|
+
let localValue;
|
|
10970
|
+
watchSyncEffect(() => {
|
|
10971
|
+
const propValue = props[name];
|
|
10972
|
+
if (hasChanged(localValue, propValue)) {
|
|
10973
|
+
localValue = propValue;
|
|
10974
|
+
trigger();
|
|
10975
|
+
}
|
|
10976
|
+
});
|
|
10977
|
+
return {
|
|
10978
|
+
get() {
|
|
10979
|
+
track();
|
|
10980
|
+
return options.get ? options.get(localValue) : localValue;
|
|
10981
|
+
},
|
|
10982
|
+
set(value) {
|
|
10983
|
+
const rawProps = i.vnode.props;
|
|
10984
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
10985
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
10986
|
+
localValue = value;
|
|
10987
|
+
trigger();
|
|
10988
|
+
}
|
|
10989
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
10990
|
+
}
|
|
10991
|
+
};
|
|
10992
|
+
});
|
|
10993
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
10994
|
+
res[Symbol.iterator] = () => {
|
|
10995
|
+
let i2 = 0;
|
|
10996
|
+
return {
|
|
10997
|
+
next() {
|
|
10998
|
+
if (i2 < 2) {
|
|
10999
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
11000
|
+
} else {
|
|
11001
|
+
return { done: true };
|
|
11002
|
+
}
|
|
11003
|
+
}
|
|
11004
|
+
};
|
|
11005
|
+
};
|
|
11006
|
+
return res;
|
|
11007
|
+
}
|
|
11008
|
+
|
|
10982
11009
|
function h(type, propsOrChildren, children) {
|
|
10983
11010
|
const l = arguments.length;
|
|
10984
11011
|
if (l === 2) {
|
|
@@ -11201,7 +11228,7 @@ Component that was made reactive: `,
|
|
|
11201
11228
|
return true;
|
|
11202
11229
|
}
|
|
11203
11230
|
|
|
11204
|
-
const version = "3.4.
|
|
11231
|
+
const version = "3.4.9";
|
|
11205
11232
|
const warn = warn$1 ;
|
|
11206
11233
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11207
11234
|
const devtools = devtools$1 ;
|
|
@@ -11714,6 +11741,7 @@ Component that was made reactive: `,
|
|
|
11714
11741
|
|
|
11715
11742
|
function patchStyle(el, prev, next) {
|
|
11716
11743
|
const style = el.style;
|
|
11744
|
+
const currentDisplay = style.display;
|
|
11717
11745
|
const isCssString = isString(next);
|
|
11718
11746
|
if (next && !isCssString) {
|
|
11719
11747
|
if (prev && !isString(prev)) {
|
|
@@ -11727,7 +11755,6 @@ Component that was made reactive: `,
|
|
|
11727
11755
|
setStyle(style, key, next[key]);
|
|
11728
11756
|
}
|
|
11729
11757
|
} else {
|
|
11730
|
-
const currentDisplay = style.display;
|
|
11731
11758
|
if (isCssString) {
|
|
11732
11759
|
if (prev !== next) {
|
|
11733
11760
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -11739,9 +11766,9 @@ Component that was made reactive: `,
|
|
|
11739
11766
|
} else if (prev) {
|
|
11740
11767
|
el.removeAttribute("style");
|
|
11741
11768
|
}
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11769
|
+
}
|
|
11770
|
+
if (vShowOldKey in el) {
|
|
11771
|
+
style.display = currentDisplay;
|
|
11745
11772
|
}
|
|
11746
11773
|
}
|
|
11747
11774
|
const semicolonRE = /[^\\];\s*$/;
|