(component): 修复 radio 不兼容 number 类型的问题

This commit is contained in:
就眠儀式 2022-10-09 14:13:21 +08:00
parent 59b999d253
commit 0575a86ff8
4 changed files with 14 additions and 14 deletions

View File

@ -9,12 +9,12 @@ export default {
import "./index.less";
export interface LayRadioProps {
size?: "lg" | "md" | "sm" | "xs";
modelValue?: string | boolean;
disabled?: boolean;
value?: string;
label?: string;
name?: string;
size?: "lg" | "md" | "sm" | "xs";
disabled?: boolean;
modelValue?: string | boolean | number;
value?: string | boolean | number;
label?: string;
}
const props = withDefaults(defineProps<LayRadioProps>(), {

View File

@ -8,7 +8,7 @@ export default {
import { provide, ref, watch } from "vue";
export interface LayRadioGroupProps {
modelValue?: string | boolean;
modelValue?: string | boolean | number;
name?: string;
disabled?: boolean;
}

View File

@ -13,10 +13,10 @@
::: demo 使用 `lay-radio` 标签, 创建一个单选框
<template>
<lay-radio v-model="selected1" name="action" value="1" label="写作"></lay-radio>
<lay-radio v-model="selected1" name="action" value="2" label="画画"></lay-radio>
<lay-radio v-model="selected1" name="action" value="3" label="运动"></lay-radio>
<lay-radio v-model="selected1" name="action" value="4">自定义slot</lay-radio>
<lay-radio v-model="selected1" name="action" :value="1" label="写作"></lay-radio>
<lay-radio v-model="selected1" name="action" :value="2" label="画画"></lay-radio>
<lay-radio v-model="selected1" name="action" :value="3" label="运动"></lay-radio>
<lay-radio v-model="selected1" name="action" :value="4">自定义slot</lay-radio>
</template>
<script>
@ -25,7 +25,7 @@ import { ref } from 'vue'
export default {
setup() {
const selected1 = ref("1");
const selected1 = ref(1);
return {
selected1

View File

@ -14,9 +14,9 @@
<template>
<lay-select v-model="value" placeholder="请选择">
<lay-select-option value="1" label="学习"></lay-select-option>
<lay-select-option value="2" label="编码"></lay-select-option>
<lay-select-option value="3" v-if="false" label="运动"></lay-select-option>
<lay-select-option :value="1" label="学习"></lay-select-option>
<lay-select-option :value="2" label="编码"></lay-select-option>
<lay-select-option :value="3" label="运动"></lay-select-option>
</lay-select>
</template>