Radio 单选框
选中值的单选框
基础用法
<template>
<LiRadioGroup v-model="val">
<LiRadio label="测试" default></LiRadio>
<LiRadio type="primary" label="测试"></LiRadio>
<LiRadio type="success" label="测试"></LiRadio>
<LiRadio type="danger" label="测试"></LiRadio>
<LiRadio type="warning" label="测试"></LiRadio>
<LiRadio type="info" label="测试"></LiRadio>
</LiRadioGroup>
</template>
<script setup lang="ts">
import { ref } from "vue";
const val = ref(false);
</script>
禁用状态
使用disabled
控制禁用状态
<template>
<LiRadioGroup v-model="val" disabled>
<LiRadio>测试</LiRadio>
<LiRadio type="primary">测试</LiRadio>
<LiRadio type="success">测试</LiRadio>
<LiRadio type="danger">测试</LiRadio>
<LiRadio type="warning">测试</LiRadio>
<LiRadio type="info">测试</LiRadio>
</LiRadioGroup>
</template>
<script setup lang="ts">
import { ref } from "vue";
const val = ref(false);
</script>
插槽
<template>
<LiRadioGroup v-model="val">
<LiRadio>测试</LiRadio>
<LiRadio type="primary">测试</LiRadio>
<LiRadio type="success">测试</LiRadio>
<LiRadio type="danger">测试</LiRadio>
<LiRadio type="warning">测试</LiRadio>
<LiRadio type="info">测试</LiRadio>
</LiRadioGroup>
</template>
<script setup lang="ts">
import { ref } from "vue";
const val = ref(false);
</script>
Input Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
disabled | 禁用 | boolean | false | |
default | 默认 | boolean | false | |
type | 类型 | string | default / primary / success / warning / info / danger | default |
Input Slots
插槽名 | 说明 |
---|---|
- | 默认 |