瀏覽代碼

fix(form): radioButtonGroup value support number

无木 3 年之前
父節點
當前提交
bbddf30e96
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/components/Form/src/components/RadioButtonGroup.vue

+ 2 - 2
src/components/Form/src/components/RadioButtonGroup.vue

@@ -17,7 +17,7 @@
   import { isString } from '/@/utils/is';
   import { useRuleFormItem } from '/@/hooks/component/useFormItem';
   import { useAttrs } from '/@/hooks/core/useAttrs';
-  type OptionsItem = { label: string; value: string; disabled?: boolean };
+  type OptionsItem = { label: string; value: string | number; disabled?: boolean };
   type RadioItem = string | OptionsItem;
 
   export default defineComponent({
@@ -28,7 +28,7 @@
     },
     props: {
       value: {
-        type: String as PropType<string>,
+        type: [String, Number] as PropType<string | number>,
       },
       options: {
         type: Array as PropType<RadioItem[]>,