Skip to content

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禁用booleanfalse
default默认booleanfalse
type类型stringdefault / primary / success / warning / info / dangerdefault

Input Slots

插槽名说明
-默认

Released under the MIT License.