@vue/runtime-core 3.4.8 → 3.4.10
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-core.cjs.js +72 -62
- package/dist/runtime-core.cjs.prod.js +51 -46
- package/dist/runtime-core.d.ts +12 -11
- package/dist/runtime-core.esm-bundler.js +75 -65
- package/package.json +17 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.4.
|
|
2
|
+
* @vue/runtime-core v3.4.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1192,6 +1192,10 @@ const SuspenseImpl = {
|
|
|
1192
1192
|
rendererInternals
|
|
1193
1193
|
);
|
|
1194
1194
|
} else {
|
|
1195
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
1196
|
+
n2.suspense = n1.suspense;
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1195
1199
|
patchSuspense(
|
|
1196
1200
|
n1,
|
|
1197
1201
|
n2,
|
|
@@ -3292,58 +3296,6 @@ function useSlots() {
|
|
|
3292
3296
|
function useAttrs() {
|
|
3293
3297
|
return getContext().attrs;
|
|
3294
3298
|
}
|
|
3295
|
-
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
3296
|
-
const i = getCurrentInstance();
|
|
3297
|
-
if (!i) {
|
|
3298
|
-
warn$1(`useModel() called without active instance.`);
|
|
3299
|
-
return reactivity.ref();
|
|
3300
|
-
}
|
|
3301
|
-
if (!i.propsOptions[0][name]) {
|
|
3302
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
3303
|
-
return reactivity.ref();
|
|
3304
|
-
}
|
|
3305
|
-
const camelizedName = shared.camelize(name);
|
|
3306
|
-
const hyphenatedName = shared.hyphenate(name);
|
|
3307
|
-
const res = reactivity.customRef((track, trigger) => {
|
|
3308
|
-
let localValue;
|
|
3309
|
-
watchSyncEffect(() => {
|
|
3310
|
-
const propValue = props[name];
|
|
3311
|
-
if (shared.hasChanged(localValue, propValue)) {
|
|
3312
|
-
localValue = propValue;
|
|
3313
|
-
trigger();
|
|
3314
|
-
}
|
|
3315
|
-
});
|
|
3316
|
-
return {
|
|
3317
|
-
get() {
|
|
3318
|
-
track();
|
|
3319
|
-
return options.get ? options.get(localValue) : localValue;
|
|
3320
|
-
},
|
|
3321
|
-
set(value) {
|
|
3322
|
-
const rawProps = i.vnode.props;
|
|
3323
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
3324
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && shared.hasChanged(value, localValue)) {
|
|
3325
|
-
localValue = value;
|
|
3326
|
-
trigger();
|
|
3327
|
-
}
|
|
3328
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
3329
|
-
}
|
|
3330
|
-
};
|
|
3331
|
-
});
|
|
3332
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
3333
|
-
res[Symbol.iterator] = () => {
|
|
3334
|
-
let i2 = 0;
|
|
3335
|
-
return {
|
|
3336
|
-
next() {
|
|
3337
|
-
if (i2 < 2) {
|
|
3338
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
3339
|
-
} else {
|
|
3340
|
-
return { done: true };
|
|
3341
|
-
}
|
|
3342
|
-
}
|
|
3343
|
-
};
|
|
3344
|
-
};
|
|
3345
|
-
return res;
|
|
3346
|
-
}
|
|
3347
3299
|
function getContext() {
|
|
3348
3300
|
const i = getCurrentInstance();
|
|
3349
3301
|
if (!i) {
|
|
@@ -5130,8 +5082,13 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5130
5082
|
actual = el.hasAttribute(key);
|
|
5131
5083
|
expected = shared.includeBooleanAttr(clientValue);
|
|
5132
5084
|
} else {
|
|
5133
|
-
|
|
5134
|
-
|
|
5085
|
+
if (el.hasAttribute(key)) {
|
|
5086
|
+
actual = el.getAttribute(key);
|
|
5087
|
+
} else {
|
|
5088
|
+
const serverValue = el[key];
|
|
5089
|
+
actual = shared.isObject(serverValue) || serverValue == null ? "" : String(serverValue);
|
|
5090
|
+
}
|
|
5091
|
+
expected = shared.isObject(clientValue) || clientValue == null ? "" : String(clientValue);
|
|
5135
5092
|
}
|
|
5136
5093
|
if (actual !== expected) {
|
|
5137
5094
|
mismatchType = `attribute`;
|
|
@@ -5140,15 +5097,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5140
5097
|
}
|
|
5141
5098
|
if (mismatchType) {
|
|
5142
5099
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
el,
|
|
5146
|
-
`
|
|
5100
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
5101
|
+
const postSegment = `
|
|
5147
5102
|
- rendered on server: ${format(actual)}
|
|
5148
5103
|
- expected on client: ${format(expected)}
|
|
5149
5104
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
5150
|
-
You should fix the source of the mismatch
|
|
5151
|
-
|
|
5105
|
+
You should fix the source of the mismatch.`;
|
|
5106
|
+
{
|
|
5107
|
+
warn$1(preSegment, el, postSegment);
|
|
5108
|
+
}
|
|
5152
5109
|
return true;
|
|
5153
5110
|
}
|
|
5154
5111
|
return false;
|
|
@@ -7821,6 +7778,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7821
7778
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7822
7779
|
};
|
|
7823
7780
|
|
|
7781
|
+
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
7782
|
+
const i = getCurrentInstance();
|
|
7783
|
+
if (!i) {
|
|
7784
|
+
warn$1(`useModel() called without active instance.`);
|
|
7785
|
+
return reactivity.ref();
|
|
7786
|
+
}
|
|
7787
|
+
if (!i.propsOptions[0][name]) {
|
|
7788
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
7789
|
+
return reactivity.ref();
|
|
7790
|
+
}
|
|
7791
|
+
const camelizedName = shared.camelize(name);
|
|
7792
|
+
const hyphenatedName = shared.hyphenate(name);
|
|
7793
|
+
const res = reactivity.customRef((track, trigger) => {
|
|
7794
|
+
let localValue;
|
|
7795
|
+
watchSyncEffect(() => {
|
|
7796
|
+
const propValue = props[name];
|
|
7797
|
+
if (shared.hasChanged(localValue, propValue)) {
|
|
7798
|
+
localValue = propValue;
|
|
7799
|
+
trigger();
|
|
7800
|
+
}
|
|
7801
|
+
});
|
|
7802
|
+
return {
|
|
7803
|
+
get() {
|
|
7804
|
+
track();
|
|
7805
|
+
return options.get ? options.get(localValue) : localValue;
|
|
7806
|
+
},
|
|
7807
|
+
set(value) {
|
|
7808
|
+
const rawProps = i.vnode.props;
|
|
7809
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
7810
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && shared.hasChanged(value, localValue)) {
|
|
7811
|
+
localValue = value;
|
|
7812
|
+
trigger();
|
|
7813
|
+
}
|
|
7814
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
7815
|
+
}
|
|
7816
|
+
};
|
|
7817
|
+
});
|
|
7818
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
7819
|
+
res[Symbol.iterator] = () => {
|
|
7820
|
+
let i2 = 0;
|
|
7821
|
+
return {
|
|
7822
|
+
next() {
|
|
7823
|
+
if (i2 < 2) {
|
|
7824
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
7825
|
+
} else {
|
|
7826
|
+
return { done: true };
|
|
7827
|
+
}
|
|
7828
|
+
}
|
|
7829
|
+
};
|
|
7830
|
+
};
|
|
7831
|
+
return res;
|
|
7832
|
+
}
|
|
7833
|
+
|
|
7824
7834
|
function h(type, propsOrChildren, children) {
|
|
7825
7835
|
const l = arguments.length;
|
|
7826
7836
|
if (l === 2) {
|
|
@@ -8047,7 +8057,7 @@ function isMemoSame(cached, memo) {
|
|
|
8047
8057
|
return true;
|
|
8048
8058
|
}
|
|
8049
8059
|
|
|
8050
|
-
const version = "3.4.
|
|
8060
|
+
const version = "3.4.10";
|
|
8051
8061
|
const warn = warn$1 ;
|
|
8052
8062
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8053
8063
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.4.
|
|
2
|
+
* @vue/runtime-core v3.4.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -691,6 +691,10 @@ const SuspenseImpl = {
|
|
|
691
691
|
rendererInternals
|
|
692
692
|
);
|
|
693
693
|
} else {
|
|
694
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
695
|
+
n2.suspense = n1.suspense;
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
694
698
|
patchSuspense(
|
|
695
699
|
n1,
|
|
696
700
|
n2,
|
|
@@ -2531,50 +2535,6 @@ function useSlots() {
|
|
|
2531
2535
|
function useAttrs() {
|
|
2532
2536
|
return getContext().attrs;
|
|
2533
2537
|
}
|
|
2534
|
-
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
2535
|
-
const i = getCurrentInstance();
|
|
2536
|
-
const camelizedName = shared.camelize(name);
|
|
2537
|
-
const hyphenatedName = shared.hyphenate(name);
|
|
2538
|
-
const res = reactivity.customRef((track, trigger) => {
|
|
2539
|
-
let localValue;
|
|
2540
|
-
watchSyncEffect(() => {
|
|
2541
|
-
const propValue = props[name];
|
|
2542
|
-
if (shared.hasChanged(localValue, propValue)) {
|
|
2543
|
-
localValue = propValue;
|
|
2544
|
-
trigger();
|
|
2545
|
-
}
|
|
2546
|
-
});
|
|
2547
|
-
return {
|
|
2548
|
-
get() {
|
|
2549
|
-
track();
|
|
2550
|
-
return options.get ? options.get(localValue) : localValue;
|
|
2551
|
-
},
|
|
2552
|
-
set(value) {
|
|
2553
|
-
const rawProps = i.vnode.props;
|
|
2554
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
2555
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && shared.hasChanged(value, localValue)) {
|
|
2556
|
-
localValue = value;
|
|
2557
|
-
trigger();
|
|
2558
|
-
}
|
|
2559
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
2560
|
-
}
|
|
2561
|
-
};
|
|
2562
|
-
});
|
|
2563
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
2564
|
-
res[Symbol.iterator] = () => {
|
|
2565
|
-
let i2 = 0;
|
|
2566
|
-
return {
|
|
2567
|
-
next() {
|
|
2568
|
-
if (i2 < 2) {
|
|
2569
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
2570
|
-
} else {
|
|
2571
|
-
return { done: true };
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
};
|
|
2575
|
-
};
|
|
2576
|
-
return res;
|
|
2577
|
-
}
|
|
2578
2538
|
function getContext() {
|
|
2579
2539
|
const i = getCurrentInstance();
|
|
2580
2540
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
@@ -6221,6 +6181,51 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
6221
6181
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
6222
6182
|
};
|
|
6223
6183
|
|
|
6184
|
+
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
6185
|
+
const i = getCurrentInstance();
|
|
6186
|
+
const camelizedName = shared.camelize(name);
|
|
6187
|
+
const hyphenatedName = shared.hyphenate(name);
|
|
6188
|
+
const res = reactivity.customRef((track, trigger) => {
|
|
6189
|
+
let localValue;
|
|
6190
|
+
watchSyncEffect(() => {
|
|
6191
|
+
const propValue = props[name];
|
|
6192
|
+
if (shared.hasChanged(localValue, propValue)) {
|
|
6193
|
+
localValue = propValue;
|
|
6194
|
+
trigger();
|
|
6195
|
+
}
|
|
6196
|
+
});
|
|
6197
|
+
return {
|
|
6198
|
+
get() {
|
|
6199
|
+
track();
|
|
6200
|
+
return options.get ? options.get(localValue) : localValue;
|
|
6201
|
+
},
|
|
6202
|
+
set(value) {
|
|
6203
|
+
const rawProps = i.vnode.props;
|
|
6204
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
6205
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && shared.hasChanged(value, localValue)) {
|
|
6206
|
+
localValue = value;
|
|
6207
|
+
trigger();
|
|
6208
|
+
}
|
|
6209
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
6210
|
+
}
|
|
6211
|
+
};
|
|
6212
|
+
});
|
|
6213
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
6214
|
+
res[Symbol.iterator] = () => {
|
|
6215
|
+
let i2 = 0;
|
|
6216
|
+
return {
|
|
6217
|
+
next() {
|
|
6218
|
+
if (i2 < 2) {
|
|
6219
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
6220
|
+
} else {
|
|
6221
|
+
return { done: true };
|
|
6222
|
+
}
|
|
6223
|
+
}
|
|
6224
|
+
};
|
|
6225
|
+
};
|
|
6226
|
+
return res;
|
|
6227
|
+
}
|
|
6228
|
+
|
|
6224
6229
|
function h(type, propsOrChildren, children) {
|
|
6225
6230
|
const l = arguments.length;
|
|
6226
6231
|
if (l === 2) {
|
|
@@ -6273,7 +6278,7 @@ function isMemoSame(cached, memo) {
|
|
|
6273
6278
|
return true;
|
|
6274
6279
|
}
|
|
6275
6280
|
|
|
6276
|
-
const version = "3.4.
|
|
6281
|
+
const version = "3.4.10";
|
|
6277
6282
|
const warn$1 = shared.NOOP;
|
|
6278
6283
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6279
6284
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1281,6 +1281,10 @@ export type ModelRef<T, M extends string | number | symbol = string> = Ref<T> &
|
|
|
1281
1281
|
ModelRef<T, M>,
|
|
1282
1282
|
Record<M, true | undefined>
|
|
1283
1283
|
];
|
|
1284
|
+
type DefineModelOptions<T = any> = {
|
|
1285
|
+
get?: (v: T) => any;
|
|
1286
|
+
set?: (v: T) => any;
|
|
1287
|
+
};
|
|
1284
1288
|
/**
|
|
1285
1289
|
* Vue `<script setup>` compiler macro for declaring a
|
|
1286
1290
|
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
@@ -1316,18 +1320,18 @@ export type ModelRef<T, M extends string | number | symbol = string> = Ref<T> &
|
|
|
1316
1320
|
*/
|
|
1317
1321
|
export declare function defineModel<T, M extends string | number | symbol = string>(options: {
|
|
1318
1322
|
required: true;
|
|
1319
|
-
} & PropOptions<T> &
|
|
1323
|
+
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
1320
1324
|
export declare function defineModel<T, M extends string | number | symbol = string>(options: {
|
|
1321
1325
|
default: any;
|
|
1322
|
-
} & PropOptions<T> &
|
|
1323
|
-
export declare function defineModel<T, M extends string | number | symbol = string>(options?: PropOptions<T> &
|
|
1326
|
+
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
1327
|
+
export declare function defineModel<T, M extends string | number | symbol = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
|
|
1324
1328
|
export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
|
|
1325
1329
|
required: true;
|
|
1326
|
-
} & PropOptions<T> &
|
|
1330
|
+
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
1327
1331
|
export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
|
|
1328
1332
|
default: any;
|
|
1329
|
-
} & PropOptions<T> &
|
|
1330
|
-
export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options?: PropOptions<T> &
|
|
1333
|
+
} & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
|
|
1334
|
+
export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
|
|
1331
1335
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1332
1336
|
type InferDefaults<T> = {
|
|
1333
1337
|
[K in keyof T]?: InferDefault<T, T[K]>;
|
|
@@ -1362,11 +1366,8 @@ type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof
|
|
|
1362
1366
|
export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
1363
1367
|
export declare function useSlots(): SetupContext['slots'];
|
|
1364
1368
|
export declare function useAttrs(): SetupContext['attrs'];
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
set?: (v: T) => any;
|
|
1368
|
-
};
|
|
1369
|
-
export declare function useModel<M extends string | number | symbol, T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: UseModelOptions<T[K]>): ModelRef<T[K], M>;
|
|
1369
|
+
|
|
1370
|
+
export declare function useModel<M extends string | number | symbol, T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: DefineModelOptions<T[K]>): ModelRef<T[K], M>;
|
|
1370
1371
|
|
|
1371
1372
|
type RawProps = VNodeProps & {
|
|
1372
1373
|
__v_isVNode?: never;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.4.
|
|
2
|
+
* @vue/runtime-core v3.4.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track,
|
|
6
|
+
import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, customRef, isReadonly } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
8
|
import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
@@ -1194,6 +1194,10 @@ const SuspenseImpl = {
|
|
|
1194
1194
|
rendererInternals
|
|
1195
1195
|
);
|
|
1196
1196
|
} else {
|
|
1197
|
+
if (parentSuspense && parentSuspense.deps > 0) {
|
|
1198
|
+
n2.suspense = n1.suspense;
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1197
1201
|
patchSuspense(
|
|
1198
1202
|
n1,
|
|
1199
1203
|
n2,
|
|
@@ -3296,58 +3300,6 @@ function useSlots() {
|
|
|
3296
3300
|
function useAttrs() {
|
|
3297
3301
|
return getContext().attrs;
|
|
3298
3302
|
}
|
|
3299
|
-
function useModel(props, name, options = EMPTY_OBJ) {
|
|
3300
|
-
const i = getCurrentInstance();
|
|
3301
|
-
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
3302
|
-
warn$1(`useModel() called without active instance.`);
|
|
3303
|
-
return ref();
|
|
3304
|
-
}
|
|
3305
|
-
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
3306
|
-
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
3307
|
-
return ref();
|
|
3308
|
-
}
|
|
3309
|
-
const camelizedName = camelize(name);
|
|
3310
|
-
const hyphenatedName = hyphenate(name);
|
|
3311
|
-
const res = customRef((track, trigger) => {
|
|
3312
|
-
let localValue;
|
|
3313
|
-
watchSyncEffect(() => {
|
|
3314
|
-
const propValue = props[name];
|
|
3315
|
-
if (hasChanged(localValue, propValue)) {
|
|
3316
|
-
localValue = propValue;
|
|
3317
|
-
trigger();
|
|
3318
|
-
}
|
|
3319
|
-
});
|
|
3320
|
-
return {
|
|
3321
|
-
get() {
|
|
3322
|
-
track();
|
|
3323
|
-
return options.get ? options.get(localValue) : localValue;
|
|
3324
|
-
},
|
|
3325
|
-
set(value) {
|
|
3326
|
-
const rawProps = i.vnode.props;
|
|
3327
|
-
if (!(rawProps && // check if parent has passed v-model
|
|
3328
|
-
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
3329
|
-
localValue = value;
|
|
3330
|
-
trigger();
|
|
3331
|
-
}
|
|
3332
|
-
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
3333
|
-
}
|
|
3334
|
-
};
|
|
3335
|
-
});
|
|
3336
|
-
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
3337
|
-
res[Symbol.iterator] = () => {
|
|
3338
|
-
let i2 = 0;
|
|
3339
|
-
return {
|
|
3340
|
-
next() {
|
|
3341
|
-
if (i2 < 2) {
|
|
3342
|
-
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
3343
|
-
} else {
|
|
3344
|
-
return { done: true };
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
};
|
|
3348
|
-
};
|
|
3349
|
-
return res;
|
|
3350
|
-
}
|
|
3351
3303
|
function getContext() {
|
|
3352
3304
|
const i = getCurrentInstance();
|
|
3353
3305
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
@@ -5148,8 +5100,13 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5148
5100
|
actual = el.hasAttribute(key);
|
|
5149
5101
|
expected = includeBooleanAttr(clientValue);
|
|
5150
5102
|
} else {
|
|
5151
|
-
|
|
5152
|
-
|
|
5103
|
+
if (el.hasAttribute(key)) {
|
|
5104
|
+
actual = el.getAttribute(key);
|
|
5105
|
+
} else {
|
|
5106
|
+
const serverValue = el[key];
|
|
5107
|
+
actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
|
|
5108
|
+
}
|
|
5109
|
+
expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
|
|
5153
5110
|
}
|
|
5154
5111
|
if (actual !== expected) {
|
|
5155
5112
|
mismatchType = `attribute`;
|
|
@@ -5158,15 +5115,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5158
5115
|
}
|
|
5159
5116
|
if (mismatchType) {
|
|
5160
5117
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
el,
|
|
5164
|
-
`
|
|
5118
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
5119
|
+
const postSegment = `
|
|
5165
5120
|
- rendered on server: ${format(actual)}
|
|
5166
5121
|
- expected on client: ${format(expected)}
|
|
5167
5122
|
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
5168
|
-
You should fix the source of the mismatch
|
|
5169
|
-
|
|
5123
|
+
You should fix the source of the mismatch.`;
|
|
5124
|
+
{
|
|
5125
|
+
warn$1(preSegment, el, postSegment);
|
|
5126
|
+
}
|
|
5170
5127
|
return true;
|
|
5171
5128
|
}
|
|
5172
5129
|
return false;
|
|
@@ -7893,6 +7850,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7893
7850
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7894
7851
|
};
|
|
7895
7852
|
|
|
7853
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
7854
|
+
const i = getCurrentInstance();
|
|
7855
|
+
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
7856
|
+
warn$1(`useModel() called without active instance.`);
|
|
7857
|
+
return ref();
|
|
7858
|
+
}
|
|
7859
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
7860
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
7861
|
+
return ref();
|
|
7862
|
+
}
|
|
7863
|
+
const camelizedName = camelize(name);
|
|
7864
|
+
const hyphenatedName = hyphenate(name);
|
|
7865
|
+
const res = customRef((track, trigger) => {
|
|
7866
|
+
let localValue;
|
|
7867
|
+
watchSyncEffect(() => {
|
|
7868
|
+
const propValue = props[name];
|
|
7869
|
+
if (hasChanged(localValue, propValue)) {
|
|
7870
|
+
localValue = propValue;
|
|
7871
|
+
trigger();
|
|
7872
|
+
}
|
|
7873
|
+
});
|
|
7874
|
+
return {
|
|
7875
|
+
get() {
|
|
7876
|
+
track();
|
|
7877
|
+
return options.get ? options.get(localValue) : localValue;
|
|
7878
|
+
},
|
|
7879
|
+
set(value) {
|
|
7880
|
+
const rawProps = i.vnode.props;
|
|
7881
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
7882
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
7883
|
+
localValue = value;
|
|
7884
|
+
trigger();
|
|
7885
|
+
}
|
|
7886
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
7887
|
+
}
|
|
7888
|
+
};
|
|
7889
|
+
});
|
|
7890
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
7891
|
+
res[Symbol.iterator] = () => {
|
|
7892
|
+
let i2 = 0;
|
|
7893
|
+
return {
|
|
7894
|
+
next() {
|
|
7895
|
+
if (i2 < 2) {
|
|
7896
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
7897
|
+
} else {
|
|
7898
|
+
return { done: true };
|
|
7899
|
+
}
|
|
7900
|
+
}
|
|
7901
|
+
};
|
|
7902
|
+
};
|
|
7903
|
+
return res;
|
|
7904
|
+
}
|
|
7905
|
+
|
|
7896
7906
|
function h(type, propsOrChildren, children) {
|
|
7897
7907
|
const l = arguments.length;
|
|
7898
7908
|
if (l === 2) {
|
|
@@ -8119,11 +8129,11 @@ function isMemoSame(cached, memo) {
|
|
|
8119
8129
|
return true;
|
|
8120
8130
|
}
|
|
8121
8131
|
|
|
8122
|
-
const version = "3.4.
|
|
8132
|
+
const version = "3.4.10";
|
|
8123
8133
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8124
8134
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8125
|
-
const devtools = !!(process.env.NODE_ENV !== "production") ||
|
|
8126
|
-
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") ||
|
|
8135
|
+
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
8136
|
+
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
8127
8137
|
const _ssrUtils = {
|
|
8128
8138
|
createComponentInstance,
|
|
8129
8139
|
setupComponent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.10",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -9,6 +9,20 @@
|
|
|
9
9
|
"index.js",
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/runtime-core.d.ts",
|
|
15
|
+
"node": {
|
|
16
|
+
"production": "./dist/runtime-core.cjs.prod.js",
|
|
17
|
+
"development": "./dist/runtime-core.cjs.js",
|
|
18
|
+
"default": "./index.js"
|
|
19
|
+
},
|
|
20
|
+
"module": "./dist/runtime-core.esm-bundler.js",
|
|
21
|
+
"import": "./dist/runtime-core.esm-bundler.js",
|
|
22
|
+
"require": "./index.js"
|
|
23
|
+
},
|
|
24
|
+
"./*": "./*"
|
|
25
|
+
},
|
|
12
26
|
"buildOptions": {
|
|
13
27
|
"name": "VueRuntimeCore",
|
|
14
28
|
"formats": [
|
|
@@ -32,7 +46,7 @@
|
|
|
32
46
|
},
|
|
33
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
34
48
|
"dependencies": {
|
|
35
|
-
"@vue/
|
|
36
|
-
"@vue/
|
|
49
|
+
"@vue/shared": "3.4.10",
|
|
50
|
+
"@vue/reactivity": "3.4.10"
|
|
37
51
|
}
|
|
38
52
|
}
|