File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/runtime/components/forms Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,10 @@ export default defineComponent({
322
322
}
323
323
})
324
324
325
+ function isObject(object : any ): object is boolean {
326
+ return ! Array .isArray (object ) && object !== null && typeof object === ' object'
327
+ }
328
+
325
329
const label = computed (() => {
326
330
if (! props .modelValue ) return null
327
331
@@ -334,7 +338,7 @@ export default defineComponent({
334
338
}
335
339
336
340
function compareValues(value1 : any , value2 : any ) {
337
- if (by .value && typeof by .value !== ' function' && typeof value1 === ' object ' && typeof value2 === ' object ' ) {
341
+ if (by .value && typeof by .value !== ' function' && isObject ( value1 ) && isObject ( value2 ) ) {
338
342
return isEqual (value1 [props .by ], value2 [props .by ])
339
343
}
340
344
return isEqual (value1 , value2 )
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ export default defineComponent({
389
389
390
390
const selected = computed (() => {
391
391
function compareValues(value1 : any , value2 : any ) {
392
- if (by .value && typeof by .value !== ' function' && typeof value1 === ' object ' && typeof value2 === ' object ' ) {
392
+ if (by .value && typeof by .value !== ' function' && isObject ( value1 ) && isObject ( value2 ) ) {
393
393
return isEqual (value1 [by .value ], value2 [by .value ])
394
394
}
395
395
return isEqual (value1 , value2 )
@@ -527,6 +527,10 @@ export default defineComponent({
527
527
return get (obj , key )
528
528
}
529
529
530
+ function isObject(object : any ): object is boolean {
531
+ return ! Array .isArray (object ) && object !== null && typeof object === ' object'
532
+ }
533
+
530
534
const filteredOptions = computed (() => {
531
535
if (! query .value || debouncedSearch ) {
532
536
return options .value
You can’t perform that action at this time.
0 commit comments