Skip to content

Commit 7c732dc

Browse files
fix if value.value is number
1 parent 8446d7f commit 7c732dc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/plugin/components/fields/VSFButtonField/VSFButtonField.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,17 @@ const isActive = (val: string | number): boolean | undefined => {
317317
return undefined;
318318
}
319319
320-
return value.value === val || (value.value as string[]).includes(val as string);
320+
// If value.value is a number, compare directly.
321+
if (typeof value.value === 'number') {
322+
return value.value === val;
323+
}
324+
325+
// If value.value is a string or an array of strings, handle both cases.
326+
if (typeof value.value === 'string' || Array.isArray(value.value)) {
327+
return (value.value as string[]).includes(val as string);
328+
}
329+
330+
return undefined;
321331
};
322332
323333
// ------------------------- Variants //

0 commit comments

Comments
 (0)