@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
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -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);
|
|
@@ -3166,8 +3171,6 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3166
3171
|
return false;
|
|
3167
3172
|
}
|
|
3168
3173
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3169
|
-
if (!el)
|
|
3170
|
-
return;
|
|
3171
3174
|
while (parent) {
|
|
3172
3175
|
const root = parent.subTree;
|
|
3173
3176
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
@@ -3263,6 +3266,10 @@ const SuspenseImpl = {
|
|
|
3263
3266
|
rendererInternals
|
|
3264
3267
|
);
|
|
3265
3268
|
} else {
|
|
3269
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
3270
|
+
n2.suspense = n1.suspense;
|
|
3271
|
+
return;
|
|
3272
|
+
}
|
|
3266
3273
|
patchSuspense(
|
|
3267
3274
|
n1,
|
|
3268
3275
|
n2,
|
|
@@ -3812,7 +3819,12 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
3812
3819
|
function setActiveBranch(suspense, branch) {
|
|
3813
3820
|
suspense.activeBranch = branch;
|
|
3814
3821
|
const { vnode, parentComponent } = suspense;
|
|
3815
|
-
|
|
3822
|
+
let el = branch.el;
|
|
3823
|
+
while (!el && branch.component) {
|
|
3824
|
+
branch = branch.component.subTree;
|
|
3825
|
+
el = branch.el;
|
|
3826
|
+
}
|
|
3827
|
+
vnode.el = el;
|
|
3816
3828
|
if (parentComponent && parentComponent.subTree === vnode) {
|
|
3817
3829
|
parentComponent.vnode.el = el;
|
|
3818
3830
|
updateHOCHostEl(parentComponent, el);
|
|
@@ -5933,58 +5945,6 @@ function useSlots() {
|
|
|
5933
5945
|
function useAttrs() {
|
|
5934
5946
|
return getContext().attrs;
|
|
5935
5947
|
}
|
|
5936
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
5937
|
-
const i = getCurrentInstance();
|
|
5938
|
-
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
5939
|
-
warn$1(`useModel() called without active instance.`);
|
|
5940
|
-
return ref();
|
|
5941
|
-
}
|
|
5942
|
-
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
5943
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
5944
|
-
return ref();
|
|
5945
|
-
}
|
|
5946
|
-
const camelizedName = camelize(name);
|
|
5947
|
-
const hyphenatedName = hyphenate(name);
|
|
5948
|
-
const res = customRef((track, trigger) => {
|
|
5949
|
-
let localValue;
|
|
5950
|
-
watchSyncEffect(() => {
|
|
5951
|
-
const propValue = props[name];
|
|
5952
|
-
if (hasChanged(localValue, propValue)) {
|
|
5953
|
-
localValue = propValue;
|
|
5954
|
-
trigger();
|
|
5955
|
-
}
|
|
5956
|
-
});
|
|
5957
|
-
return {
|
|
5958
|
-
get() {
|
|
5959
|
-
track();
|
|
5960
|
-
return options.get ? options.get(localValue) : localValue;
|
|
5961
|
-
},
|
|
5962
|
-
set(value) {
|
|
5963
|
-
const rawProps = i.vnode.props;
|
|
5964
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
5965
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
5966
|
-
localValue = value;
|
|
5967
|
-
trigger();
|
|
5968
|
-
}
|
|
5969
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
5970
|
-
}
|
|
5971
|
-
};
|
|
5972
|
-
});
|
|
5973
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
5974
|
-
res[Symbol.iterator] = () => {
|
|
5975
|
-
let i2 = 0;
|
|
5976
|
-
return {
|
|
5977
|
-
next() {
|
|
5978
|
-
if (i2 < 2) {
|
|
5979
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
5980
|
-
} else {
|
|
5981
|
-
return { done: true };
|
|
5982
|
-
}
|
|
5983
|
-
}
|
|
5984
|
-
};
|
|
5985
|
-
};
|
|
5986
|
-
return res;
|
|
5987
|
-
}
|
|
5988
5948
|
function getContext() {
|
|
5989
5949
|
const i = getCurrentInstance();
|
|
5990
5950
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
@@ -6558,7 +6518,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6558
6518
|
return vm;
|
|
6559
6519
|
}
|
|
6560
6520
|
}
|
|
6561
|
-
Vue.version = `2.6.14-compat:${"3.4.
|
|
6521
|
+
Vue.version = `2.6.14-compat:${"3.4.9"}`;
|
|
6562
6522
|
Vue.config = singletonApp.config;
|
|
6563
6523
|
Vue.use = (p, ...options) => {
|
|
6564
6524
|
if (p && isFunction(p.install)) {
|
|
@@ -8297,29 +8257,43 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
8297
8257
|
let actual;
|
|
8298
8258
|
let expected;
|
|
8299
8259
|
if (key === "class") {
|
|
8300
|
-
actual =
|
|
8301
|
-
expected =
|
|
8302
|
-
if (!isSetEqual(actual, expected)) {
|
|
8260
|
+
actual = el.getAttribute("class");
|
|
8261
|
+
expected = normalizeClass(clientValue);
|
|
8262
|
+
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
8303
8263
|
mismatchType = mismatchKey = `class`;
|
|
8304
8264
|
}
|
|
8305
8265
|
} else if (key === "style") {
|
|
8306
|
-
actual =
|
|
8307
|
-
expected =
|
|
8308
|
-
|
|
8309
|
-
);
|
|
8266
|
+
actual = el.getAttribute("style");
|
|
8267
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
8268
|
+
const actualMap = toStyleMap(actual);
|
|
8269
|
+
const expectedMap = toStyleMap(expected);
|
|
8310
8270
|
if (vnode.dirs) {
|
|
8311
8271
|
for (const { dir, value } of vnode.dirs) {
|
|
8312
8272
|
if (dir.name === "show" && !value) {
|
|
8313
|
-
|
|
8273
|
+
expectedMap.set("display", "none");
|
|
8314
8274
|
}
|
|
8315
8275
|
}
|
|
8316
8276
|
}
|
|
8317
|
-
if (!isMapEqual(
|
|
8277
|
+
if (!isMapEqual(actualMap, expectedMap)) {
|
|
8318
8278
|
mismatchType = mismatchKey = "style";
|
|
8319
8279
|
}
|
|
8320
8280
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
8321
|
-
|
|
8322
|
-
|
|
8281
|
+
if (isBooleanAttr(key)) {
|
|
8282
|
+
actual = el.hasAttribute(key);
|
|
8283
|
+
expected = includeBooleanAttr(clientValue);
|
|
8284
|
+
} else {
|
|
8285
|
+
if (el.hasAttribute(key)) {
|
|
8286
|
+
actual = el.getAttribute(key);
|
|
8287
|
+
} else if (key in el) {
|
|
8288
|
+
const serverValue = el[key];
|
|
8289
|
+
if (!isObject(serverValue)) {
|
|
8290
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
8291
|
+
}
|
|
8292
|
+
}
|
|
8293
|
+
if (!isObject(clientValue)) {
|
|
8294
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8323
8297
|
if (actual !== expected) {
|
|
8324
8298
|
mismatchType = `attribute`;
|
|
8325
8299
|
mismatchKey = key;
|
|
@@ -8327,15 +8301,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
8327
8301
|
}
|
|
8328
8302
|
if (mismatchType) {
|
|
8329
8303
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
el,
|
|
8333
|
-
`
|
|
8304
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
8305
|
+
const postSegment = `
|
|
8334
8306
|
- rendered on server: ${format(actual)}
|
|
8335
8307
|
- expected on client: ${format(expected)}
|
|
8336
8308
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
8337
|
-
You should fix the source of the mismatch
|
|
8338
|
-
|
|
8309
|
+
You should fix the source of the mismatch.`;
|
|
8310
|
+
{
|
|
8311
|
+
warn$1(preSegment, el, postSegment);
|
|
8312
|
+
}
|
|
8339
8313
|
return true;
|
|
8340
8314
|
}
|
|
8341
8315
|
return false;
|
|
@@ -11169,6 +11143,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
11169
11143
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11170
11144
|
};
|
|
11171
11145
|
|
|
11146
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
11147
|
+
const i = getCurrentInstance();
|
|
11148
|
+
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
11149
|
+
warn$1(`useModel() called without active instance.`);
|
|
11150
|
+
return ref();
|
|
11151
|
+
}
|
|
11152
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
11153
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
11154
|
+
return ref();
|
|
11155
|
+
}
|
|
11156
|
+
const camelizedName = camelize(name);
|
|
11157
|
+
const hyphenatedName = hyphenate(name);
|
|
11158
|
+
const res = customRef((track, trigger) => {
|
|
11159
|
+
let localValue;
|
|
11160
|
+
watchSyncEffect(() => {
|
|
11161
|
+
const propValue = props[name];
|
|
11162
|
+
if (hasChanged(localValue, propValue)) {
|
|
11163
|
+
localValue = propValue;
|
|
11164
|
+
trigger();
|
|
11165
|
+
}
|
|
11166
|
+
});
|
|
11167
|
+
return {
|
|
11168
|
+
get() {
|
|
11169
|
+
track();
|
|
11170
|
+
return options.get ? options.get(localValue) : localValue;
|
|
11171
|
+
},
|
|
11172
|
+
set(value) {
|
|
11173
|
+
const rawProps = i.vnode.props;
|
|
11174
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
11175
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
11176
|
+
localValue = value;
|
|
11177
|
+
trigger();
|
|
11178
|
+
}
|
|
11179
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
11180
|
+
}
|
|
11181
|
+
};
|
|
11182
|
+
});
|
|
11183
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
11184
|
+
res[Symbol.iterator] = () => {
|
|
11185
|
+
let i2 = 0;
|
|
11186
|
+
return {
|
|
11187
|
+
next() {
|
|
11188
|
+
if (i2 < 2) {
|
|
11189
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
11190
|
+
} else {
|
|
11191
|
+
return { done: true };
|
|
11192
|
+
}
|
|
11193
|
+
}
|
|
11194
|
+
};
|
|
11195
|
+
};
|
|
11196
|
+
return res;
|
|
11197
|
+
}
|
|
11198
|
+
|
|
11172
11199
|
function h(type, propsOrChildren, children) {
|
|
11173
11200
|
const l = arguments.length;
|
|
11174
11201
|
if (l === 2) {
|
|
@@ -11391,11 +11418,11 @@ function isMemoSame(cached, memo) {
|
|
|
11391
11418
|
return true;
|
|
11392
11419
|
}
|
|
11393
11420
|
|
|
11394
|
-
const version = "3.4.
|
|
11421
|
+
const version = "3.4.9";
|
|
11395
11422
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
11396
11423
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11397
|
-
const devtools = !!(process.env.NODE_ENV !== "production") ||
|
|
11398
|
-
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") ||
|
|
11424
|
+
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
11425
|
+
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
11399
11426
|
const _ssrUtils = {
|
|
11400
11427
|
createComponentInstance,
|
|
11401
11428
|
setupComponent,
|
|
@@ -11919,6 +11946,7 @@ function setVarsOnNode(el, vars) {
|
|
|
11919
11946
|
|
|
11920
11947
|
function patchStyle(el, prev, next) {
|
|
11921
11948
|
const style = el.style;
|
|
11949
|
+
const currentDisplay = style.display;
|
|
11922
11950
|
const isCssString = isString(next);
|
|
11923
11951
|
if (next && !isCssString) {
|
|
11924
11952
|
if (prev && !isString(prev)) {
|
|
@@ -11932,7 +11960,6 @@ function patchStyle(el, prev, next) {
|
|
|
11932
11960
|
setStyle(style, key, next[key]);
|
|
11933
11961
|
}
|
|
11934
11962
|
} else {
|
|
11935
|
-
const currentDisplay = style.display;
|
|
11936
11963
|
if (isCssString) {
|
|
11937
11964
|
if (prev !== next) {
|
|
11938
11965
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -11944,9 +11971,9 @@ function patchStyle(el, prev, next) {
|
|
|
11944
11971
|
} else if (prev) {
|
|
11945
11972
|
el.removeAttribute("style");
|
|
11946
11973
|
}
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11974
|
+
}
|
|
11975
|
+
if (vShowOldKey in el) {
|
|
11976
|
+
style.display = currentDisplay;
|
|
11950
11977
|
}
|
|
11951
11978
|
}
|
|
11952
11979
|
const semicolonRE = /[^\\];\s*$/;
|
package/dist/vue.global.js
CHANGED
|
@@ -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
|
|
|
@@ -3162,8 +3167,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3162
3167
|
return false;
|
|
3163
3168
|
}
|
|
3164
3169
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3165
|
-
if (!el)
|
|
3166
|
-
return;
|
|
3167
3170
|
while (parent) {
|
|
3168
3171
|
const root = parent.subTree;
|
|
3169
3172
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
@@ -3259,6 +3262,10 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
3259
3262
|
rendererInternals
|
|
3260
3263
|
);
|
|
3261
3264
|
} else {
|
|
3265
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
3266
|
+
n2.suspense = n1.suspense;
|
|
3267
|
+
return;
|
|
3268
|
+
}
|
|
3262
3269
|
patchSuspense(
|
|
3263
3270
|
n1,
|
|
3264
3271
|
n2,
|
|
@@ -3808,7 +3815,12 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
3808
3815
|
function setActiveBranch(suspense, branch) {
|
|
3809
3816
|
suspense.activeBranch = branch;
|
|
3810
3817
|
const { vnode, parentComponent } = suspense;
|
|
3811
|
-
|
|
3818
|
+
let el = branch.el;
|
|
3819
|
+
while (!el && branch.component) {
|
|
3820
|
+
branch = branch.component.subTree;
|
|
3821
|
+
el = branch.el;
|
|
3822
|
+
}
|
|
3823
|
+
vnode.el = el;
|
|
3812
3824
|
if (parentComponent && parentComponent.subTree === vnode) {
|
|
3813
3825
|
parentComponent.vnode.el = el;
|
|
3814
3826
|
updateHOCHostEl(parentComponent, el);
|
|
@@ -5894,58 +5906,6 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5894
5906
|
function useAttrs() {
|
|
5895
5907
|
return getContext().attrs;
|
|
5896
5908
|
}
|
|
5897
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
5898
|
-
const i = getCurrentInstance();
|
|
5899
|
-
if (!i) {
|
|
5900
|
-
warn$1(`useModel() called without active instance.`);
|
|
5901
|
-
return ref();
|
|
5902
|
-
}
|
|
5903
|
-
if (!i.propsOptions[0][name]) {
|
|
5904
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
5905
|
-
return ref();
|
|
5906
|
-
}
|
|
5907
|
-
const camelizedName = camelize(name);
|
|
5908
|
-
const hyphenatedName = hyphenate(name);
|
|
5909
|
-
const res = customRef((track, trigger) => {
|
|
5910
|
-
let localValue;
|
|
5911
|
-
watchSyncEffect(() => {
|
|
5912
|
-
const propValue = props[name];
|
|
5913
|
-
if (hasChanged(localValue, propValue)) {
|
|
5914
|
-
localValue = propValue;
|
|
5915
|
-
trigger();
|
|
5916
|
-
}
|
|
5917
|
-
});
|
|
5918
|
-
return {
|
|
5919
|
-
get() {
|
|
5920
|
-
track();
|
|
5921
|
-
return options.get ? options.get(localValue) : localValue;
|
|
5922
|
-
},
|
|
5923
|
-
set(value) {
|
|
5924
|
-
const rawProps = i.vnode.props;
|
|
5925
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
5926
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
5927
|
-
localValue = value;
|
|
5928
|
-
trigger();
|
|
5929
|
-
}
|
|
5930
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
5931
|
-
}
|
|
5932
|
-
};
|
|
5933
|
-
});
|
|
5934
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
5935
|
-
res[Symbol.iterator] = () => {
|
|
5936
|
-
let i2 = 0;
|
|
5937
|
-
return {
|
|
5938
|
-
next() {
|
|
5939
|
-
if (i2 < 2) {
|
|
5940
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
5941
|
-
} else {
|
|
5942
|
-
return { done: true };
|
|
5943
|
-
}
|
|
5944
|
-
}
|
|
5945
|
-
};
|
|
5946
|
-
};
|
|
5947
|
-
return res;
|
|
5948
|
-
}
|
|
5949
5909
|
function getContext() {
|
|
5950
5910
|
const i = getCurrentInstance();
|
|
5951
5911
|
if (!i) {
|
|
@@ -6517,7 +6477,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6517
6477
|
return vm;
|
|
6518
6478
|
}
|
|
6519
6479
|
}
|
|
6520
|
-
Vue.version = `2.6.14-compat:${"3.4.
|
|
6480
|
+
Vue.version = `2.6.14-compat:${"3.4.9"}`;
|
|
6521
6481
|
Vue.config = singletonApp.config;
|
|
6522
6482
|
Vue.use = (p, ...options) => {
|
|
6523
6483
|
if (p && isFunction(p.install)) {
|
|
@@ -8243,29 +8203,43 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8243
8203
|
let actual;
|
|
8244
8204
|
let expected;
|
|
8245
8205
|
if (key === "class") {
|
|
8246
|
-
actual =
|
|
8247
|
-
expected =
|
|
8248
|
-
if (!isSetEqual(actual, expected)) {
|
|
8206
|
+
actual = el.getAttribute("class");
|
|
8207
|
+
expected = normalizeClass(clientValue);
|
|
8208
|
+
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
8249
8209
|
mismatchType = mismatchKey = `class`;
|
|
8250
8210
|
}
|
|
8251
8211
|
} else if (key === "style") {
|
|
8252
|
-
actual =
|
|
8253
|
-
expected =
|
|
8254
|
-
|
|
8255
|
-
);
|
|
8212
|
+
actual = el.getAttribute("style");
|
|
8213
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
8214
|
+
const actualMap = toStyleMap(actual);
|
|
8215
|
+
const expectedMap = toStyleMap(expected);
|
|
8256
8216
|
if (vnode.dirs) {
|
|
8257
8217
|
for (const { dir, value } of vnode.dirs) {
|
|
8258
8218
|
if (dir.name === "show" && !value) {
|
|
8259
|
-
|
|
8219
|
+
expectedMap.set("display", "none");
|
|
8260
8220
|
}
|
|
8261
8221
|
}
|
|
8262
8222
|
}
|
|
8263
|
-
if (!isMapEqual(
|
|
8223
|
+
if (!isMapEqual(actualMap, expectedMap)) {
|
|
8264
8224
|
mismatchType = mismatchKey = "style";
|
|
8265
8225
|
}
|
|
8266
8226
|
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
8267
|
-
|
|
8268
|
-
|
|
8227
|
+
if (isBooleanAttr(key)) {
|
|
8228
|
+
actual = el.hasAttribute(key);
|
|
8229
|
+
expected = includeBooleanAttr(clientValue);
|
|
8230
|
+
} else {
|
|
8231
|
+
if (el.hasAttribute(key)) {
|
|
8232
|
+
actual = el.getAttribute(key);
|
|
8233
|
+
} else if (key in el) {
|
|
8234
|
+
const serverValue = el[key];
|
|
8235
|
+
if (!isObject(serverValue)) {
|
|
8236
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
8237
|
+
}
|
|
8238
|
+
}
|
|
8239
|
+
if (!isObject(clientValue)) {
|
|
8240
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
8241
|
+
}
|
|
8242
|
+
}
|
|
8269
8243
|
if (actual !== expected) {
|
|
8270
8244
|
mismatchType = `attribute`;
|
|
8271
8245
|
mismatchKey = key;
|
|
@@ -8273,15 +8247,15 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
8273
8247
|
}
|
|
8274
8248
|
if (mismatchType) {
|
|
8275
8249
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
el,
|
|
8279
|
-
`
|
|
8250
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
8251
|
+
const postSegment = `
|
|
8280
8252
|
- rendered on server: ${format(actual)}
|
|
8281
8253
|
- expected on client: ${format(expected)}
|
|
8282
8254
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
8283
|
-
You should fix the source of the mismatch
|
|
8284
|
-
|
|
8255
|
+
You should fix the source of the mismatch.`;
|
|
8256
|
+
{
|
|
8257
|
+
warn$1(preSegment, el, postSegment);
|
|
8258
|
+
}
|
|
8285
8259
|
return true;
|
|
8286
8260
|
}
|
|
8287
8261
|
return false;
|
|
@@ -11044,6 +11018,59 @@ Component that was made reactive: `,
|
|
|
11044
11018
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
11045
11019
|
};
|
|
11046
11020
|
|
|
11021
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
11022
|
+
const i = getCurrentInstance();
|
|
11023
|
+
if (!i) {
|
|
11024
|
+
warn$1(`useModel() called without active instance.`);
|
|
11025
|
+
return ref();
|
|
11026
|
+
}
|
|
11027
|
+
if (!i.propsOptions[0][name]) {
|
|
11028
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
11029
|
+
return ref();
|
|
11030
|
+
}
|
|
11031
|
+
const camelizedName = camelize(name);
|
|
11032
|
+
const hyphenatedName = hyphenate(name);
|
|
11033
|
+
const res = customRef((track, trigger) => {
|
|
11034
|
+
let localValue;
|
|
11035
|
+
watchSyncEffect(() => {
|
|
11036
|
+
const propValue = props[name];
|
|
11037
|
+
if (hasChanged(localValue, propValue)) {
|
|
11038
|
+
localValue = propValue;
|
|
11039
|
+
trigger();
|
|
11040
|
+
}
|
|
11041
|
+
});
|
|
11042
|
+
return {
|
|
11043
|
+
get() {
|
|
11044
|
+
track();
|
|
11045
|
+
return options.get ? options.get(localValue) : localValue;
|
|
11046
|
+
},
|
|
11047
|
+
set(value) {
|
|
11048
|
+
const rawProps = i.vnode.props;
|
|
11049
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
11050
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
11051
|
+
localValue = value;
|
|
11052
|
+
trigger();
|
|
11053
|
+
}
|
|
11054
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
11055
|
+
}
|
|
11056
|
+
};
|
|
11057
|
+
});
|
|
11058
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
11059
|
+
res[Symbol.iterator] = () => {
|
|
11060
|
+
let i2 = 0;
|
|
11061
|
+
return {
|
|
11062
|
+
next() {
|
|
11063
|
+
if (i2 < 2) {
|
|
11064
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
11065
|
+
} else {
|
|
11066
|
+
return { done: true };
|
|
11067
|
+
}
|
|
11068
|
+
}
|
|
11069
|
+
};
|
|
11070
|
+
};
|
|
11071
|
+
return res;
|
|
11072
|
+
}
|
|
11073
|
+
|
|
11047
11074
|
function h(type, propsOrChildren, children) {
|
|
11048
11075
|
const l = arguments.length;
|
|
11049
11076
|
if (l === 2) {
|
|
@@ -11266,7 +11293,7 @@ Component that was made reactive: `,
|
|
|
11266
11293
|
return true;
|
|
11267
11294
|
}
|
|
11268
11295
|
|
|
11269
|
-
const version = "3.4.
|
|
11296
|
+
const version = "3.4.9";
|
|
11270
11297
|
const warn = warn$1 ;
|
|
11271
11298
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11272
11299
|
const devtools = devtools$1 ;
|
|
@@ -11779,6 +11806,7 @@ Component that was made reactive: `,
|
|
|
11779
11806
|
|
|
11780
11807
|
function patchStyle(el, prev, next) {
|
|
11781
11808
|
const style = el.style;
|
|
11809
|
+
const currentDisplay = style.display;
|
|
11782
11810
|
const isCssString = isString(next);
|
|
11783
11811
|
if (next && !isCssString) {
|
|
11784
11812
|
if (prev && !isString(prev)) {
|
|
@@ -11792,7 +11820,6 @@ Component that was made reactive: `,
|
|
|
11792
11820
|
setStyle(style, key, next[key]);
|
|
11793
11821
|
}
|
|
11794
11822
|
} else {
|
|
11795
|
-
const currentDisplay = style.display;
|
|
11796
11823
|
if (isCssString) {
|
|
11797
11824
|
if (prev !== next) {
|
|
11798
11825
|
const cssVarText = style[CSS_VAR_TEXT];
|
|
@@ -11804,9 +11831,9 @@ Component that was made reactive: `,
|
|
|
11804
11831
|
} else if (prev) {
|
|
11805
11832
|
el.removeAttribute("style");
|
|
11806
11833
|
}
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11834
|
+
}
|
|
11835
|
+
if (vShowOldKey in el) {
|
|
11836
|
+
style.display = currentDisplay;
|
|
11810
11837
|
}
|
|
11811
11838
|
}
|
|
11812
11839
|
const semicolonRE = /[^\\];\s*$/;
|