@vue/runtime-core 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-core.cjs.js +76 -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 +79 -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.9
|
|
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,17 @@ 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 if (key in el) {
|
|
5088
|
+
const serverValue = el[key];
|
|
5089
|
+
if (!shared.isObject(serverValue)) {
|
|
5090
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
5091
|
+
}
|
|
5092
|
+
}
|
|
5093
|
+
if (!shared.isObject(clientValue)) {
|
|
5094
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
5095
|
+
}
|
|
5135
5096
|
}
|
|
5136
5097
|
if (actual !== expected) {
|
|
5137
5098
|
mismatchType = `attribute`;
|
|
@@ -5140,15 +5101,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5140
5101
|
}
|
|
5141
5102
|
if (mismatchType) {
|
|
5142
5103
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
el,
|
|
5146
|
-
`
|
|
5104
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
5105
|
+
const postSegment = `
|
|
5147
5106
|
- rendered on server: ${format(actual)}
|
|
5148
5107
|
- expected on client: ${format(expected)}
|
|
5149
5108
|
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
|
-
|
|
5109
|
+
You should fix the source of the mismatch.`;
|
|
5110
|
+
{
|
|
5111
|
+
warn$1(preSegment, el, postSegment);
|
|
5112
|
+
}
|
|
5152
5113
|
return true;
|
|
5153
5114
|
}
|
|
5154
5115
|
return false;
|
|
@@ -7821,6 +7782,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7821
7782
|
return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7822
7783
|
};
|
|
7823
7784
|
|
|
7785
|
+
function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
7786
|
+
const i = getCurrentInstance();
|
|
7787
|
+
if (!i) {
|
|
7788
|
+
warn$1(`useModel() called without active instance.`);
|
|
7789
|
+
return reactivity.ref();
|
|
7790
|
+
}
|
|
7791
|
+
if (!i.propsOptions[0][name]) {
|
|
7792
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
7793
|
+
return reactivity.ref();
|
|
7794
|
+
}
|
|
7795
|
+
const camelizedName = shared.camelize(name);
|
|
7796
|
+
const hyphenatedName = shared.hyphenate(name);
|
|
7797
|
+
const res = reactivity.customRef((track, trigger) => {
|
|
7798
|
+
let localValue;
|
|
7799
|
+
watchSyncEffect(() => {
|
|
7800
|
+
const propValue = props[name];
|
|
7801
|
+
if (shared.hasChanged(localValue, propValue)) {
|
|
7802
|
+
localValue = propValue;
|
|
7803
|
+
trigger();
|
|
7804
|
+
}
|
|
7805
|
+
});
|
|
7806
|
+
return {
|
|
7807
|
+
get() {
|
|
7808
|
+
track();
|
|
7809
|
+
return options.get ? options.get(localValue) : localValue;
|
|
7810
|
+
},
|
|
7811
|
+
set(value) {
|
|
7812
|
+
const rawProps = i.vnode.props;
|
|
7813
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
7814
|
+
(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)) {
|
|
7815
|
+
localValue = value;
|
|
7816
|
+
trigger();
|
|
7817
|
+
}
|
|
7818
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
7819
|
+
}
|
|
7820
|
+
};
|
|
7821
|
+
});
|
|
7822
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
7823
|
+
res[Symbol.iterator] = () => {
|
|
7824
|
+
let i2 = 0;
|
|
7825
|
+
return {
|
|
7826
|
+
next() {
|
|
7827
|
+
if (i2 < 2) {
|
|
7828
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
7829
|
+
} else {
|
|
7830
|
+
return { done: true };
|
|
7831
|
+
}
|
|
7832
|
+
}
|
|
7833
|
+
};
|
|
7834
|
+
};
|
|
7835
|
+
return res;
|
|
7836
|
+
}
|
|
7837
|
+
|
|
7824
7838
|
function h(type, propsOrChildren, children) {
|
|
7825
7839
|
const l = arguments.length;
|
|
7826
7840
|
if (l === 2) {
|
|
@@ -8047,7 +8061,7 @@ function isMemoSame(cached, memo) {
|
|
|
8047
8061
|
return true;
|
|
8048
8062
|
}
|
|
8049
8063
|
|
|
8050
|
-
const version = "3.4.
|
|
8064
|
+
const version = "3.4.9";
|
|
8051
8065
|
const warn = warn$1 ;
|
|
8052
8066
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8053
8067
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.4.
|
|
2
|
+
* @vue/runtime-core v3.4.9
|
|
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.9";
|
|
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.9
|
|
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,17 @@ 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 if (key in el) {
|
|
5106
|
+
const serverValue = el[key];
|
|
5107
|
+
if (!isObject(serverValue)) {
|
|
5108
|
+
actual = serverValue == null ? "" : String(serverValue);
|
|
5109
|
+
}
|
|
5110
|
+
}
|
|
5111
|
+
if (!isObject(clientValue)) {
|
|
5112
|
+
expected = clientValue == null ? "" : String(clientValue);
|
|
5113
|
+
}
|
|
5153
5114
|
}
|
|
5154
5115
|
if (actual !== expected) {
|
|
5155
5116
|
mismatchType = `attribute`;
|
|
@@ -5158,15 +5119,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
|
|
|
5158
5119
|
}
|
|
5159
5120
|
if (mismatchType) {
|
|
5160
5121
|
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
el,
|
|
5164
|
-
`
|
|
5122
|
+
const preSegment = `Hydration ${mismatchType} mismatch on`;
|
|
5123
|
+
const postSegment = `
|
|
5165
5124
|
- rendered on server: ${format(actual)}
|
|
5166
5125
|
- expected on client: ${format(expected)}
|
|
5167
5126
|
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
|
-
|
|
5127
|
+
You should fix the source of the mismatch.`;
|
|
5128
|
+
{
|
|
5129
|
+
warn$1(preSegment, el, postSegment);
|
|
5130
|
+
}
|
|
5170
5131
|
return true;
|
|
5171
5132
|
}
|
|
5172
5133
|
return false;
|
|
@@ -7893,6 +7854,59 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7893
7854
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7894
7855
|
};
|
|
7895
7856
|
|
|
7857
|
+
function useModel(props, name, options = EMPTY_OBJ) {
|
|
7858
|
+
const i = getCurrentInstance();
|
|
7859
|
+
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
7860
|
+
warn$1(`useModel() called without active instance.`);
|
|
7861
|
+
return ref();
|
|
7862
|
+
}
|
|
7863
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
|
|
7864
|
+
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
7865
|
+
return ref();
|
|
7866
|
+
}
|
|
7867
|
+
const camelizedName = camelize(name);
|
|
7868
|
+
const hyphenatedName = hyphenate(name);
|
|
7869
|
+
const res = customRef((track, trigger) => {
|
|
7870
|
+
let localValue;
|
|
7871
|
+
watchSyncEffect(() => {
|
|
7872
|
+
const propValue = props[name];
|
|
7873
|
+
if (hasChanged(localValue, propValue)) {
|
|
7874
|
+
localValue = propValue;
|
|
7875
|
+
trigger();
|
|
7876
|
+
}
|
|
7877
|
+
});
|
|
7878
|
+
return {
|
|
7879
|
+
get() {
|
|
7880
|
+
track();
|
|
7881
|
+
return options.get ? options.get(localValue) : localValue;
|
|
7882
|
+
},
|
|
7883
|
+
set(value) {
|
|
7884
|
+
const rawProps = i.vnode.props;
|
|
7885
|
+
if (!(rawProps && // check if parent has passed v-model
|
|
7886
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
7887
|
+
localValue = value;
|
|
7888
|
+
trigger();
|
|
7889
|
+
}
|
|
7890
|
+
i.emit(`update:${name}`, options.set ? options.set(value) : value);
|
|
7891
|
+
}
|
|
7892
|
+
};
|
|
7893
|
+
});
|
|
7894
|
+
const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
|
|
7895
|
+
res[Symbol.iterator] = () => {
|
|
7896
|
+
let i2 = 0;
|
|
7897
|
+
return {
|
|
7898
|
+
next() {
|
|
7899
|
+
if (i2 < 2) {
|
|
7900
|
+
return { value: i2++ ? props[modifierKey] || {} : res, done: false };
|
|
7901
|
+
} else {
|
|
7902
|
+
return { done: true };
|
|
7903
|
+
}
|
|
7904
|
+
}
|
|
7905
|
+
};
|
|
7906
|
+
};
|
|
7907
|
+
return res;
|
|
7908
|
+
}
|
|
7909
|
+
|
|
7896
7910
|
function h(type, propsOrChildren, children) {
|
|
7897
7911
|
const l = arguments.length;
|
|
7898
7912
|
if (l === 2) {
|
|
@@ -8119,11 +8133,11 @@ function isMemoSame(cached, memo) {
|
|
|
8119
8133
|
return true;
|
|
8120
8134
|
}
|
|
8121
8135
|
|
|
8122
|
-
const version = "3.4.
|
|
8136
|
+
const version = "3.4.9";
|
|
8123
8137
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8124
8138
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8125
|
-
const devtools = !!(process.env.NODE_ENV !== "production") ||
|
|
8126
|
-
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") ||
|
|
8139
|
+
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
|
8140
|
+
const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
|
|
8127
8141
|
const _ssrUtils = {
|
|
8128
8142
|
createComponentInstance,
|
|
8129
8143
|
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.9",
|
|
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.9",
|
|
50
|
+
"@vue/reactivity": "3.4.9"
|
|
37
51
|
}
|
|
38
52
|
}
|