CheckBox 复选框
选中值的复选框
基础用法
<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
控制禁用状态
<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 | 禁用 | boolean | false | |
type | 类型 | string | default / primary / success / warning / info / danger | default |
Input Slots
插槽名 | 说明 |
---|---|
- | 默认 |