Skip to content

CheckBox 复选框

选中值的复选框

基础用法

选项1选项1选项1选项1选项1选项1
<template>
	<LiCheckBox label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox type="primary" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox type="success" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox type="danger" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox type="warning" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox type="info" label="选项1" v-model="val"></LiCheckBox>
</template>
<script setup lang="ts">
	import { ref } from "vue";

	const val = ref(false);
</script>

禁用状态

使用disabled控制禁用状态

选项1选项1选项1选项1选项1选项1
<template>
	<LiCheckBox disabled label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox disabled type="primary" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox disabled type="success" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox disabled type="danger" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox disabled type="warning" label="选项1" v-model="val"></LiCheckBox>
	<LiCheckBox disabled type="info" label="选项1" v-model="val"></LiCheckBox>
</template>
<script setup lang="ts">
	import { ref } from "vue";

	const val = ref(true);
</script>

插槽

选项
<template>
	<LiCheckBox v-model="val"> 选项 </LiCheckBox>
</template>
<script setup lang="ts">
	import { ref } from "vue";

	const val = ref(false);
</script>

Input Attributes

参数说明类型可选值默认值
disabled禁用booleanfalse
type类型stringdefault / primary / success / warning / info / dangerdefault

Input Slots

插槽名说明
-默认

Released under the MIT License.