ColorUI 开发文档ColorUI 开发文档
指南
组件
实验室
Api
更新日志
  • uni-app版
  • 2.x版本
  • GitHub 仓库
  • Gitee 仓库
指南
组件
实验室
Api
更新日志
  • uni-app版
  • 2.x版本
  • GitHub 仓库
  • Gitee 仓库
  • 组件

    • 引用组件
    • 主题 ui-change-theme
    • 导航栏 ui-navbar
    • 头像 ui-avatar
    • 标题 ui-title
    • 标签 ui-tag
    • 按钮 ui-btn
    • 图片 ui-img
    • 代码 ui-code
    • 进度条 ui-progress
    • 加载 ui-loading
    • 菜单 ui-menu
    • 浮动 ui-fixed
    • 卡片 ui-card
    • 栅栏 ui-grid
    • 气泡框 ui-popover
    • 模态框 ui-modal
    • 轻提示 $tips
    • 选项卡 ui-tab
    • 轮播图 ui-swiper
    • 步骤条 ui-steps
    • 输入框 ui-input
    • 单选框 ui-radio
    • 复选框 ui-checkbox
    • 开关 ui-switch

复选框 ui-checkbox

"usingComponents": {
    "ui-checkbox-group" : "/mp-cu/colorUI/components/ui-checkbox-group/ui-checkbox-group",
    "ui-checkbox" : "/mp-cu/colorUI/components/ui-checkbox/ui-checkbox"
}

基础用法

<ui-form ui="ui-BG">
    <ui-form-group title="复选框" contentui="justify-end">
        modal1:{{modal1}} <ui-checkbox value="{{modal1}}" bind:change="modal1Change">选项</ui-checkbox>
    </ui-form-group>
</ui-form>

模糊状态

<ui-form ui="ui-BG">
    <ui-form-group title="复选框" contentui="justify-end">
        modal2:{{modal2}}
        <ui-checkbox value="{{modal2}}" indeterminate bind:change="modal2Change">选项</ui-checkbox>
    </ui-form-group>
</ui-form>

大小

<ui-form ui="ui-BG">
    <ui-form-group title="大" contentui="justify-end">
        <ui-checkbox ui="round lg" value="{{size1}}" bind:change="size1Change">选项1</ui-checkbox>
        <ui-checkbox ui="lg" value="{{size2}}" bind:change="size2Change">选项2</ui-checkbox>
    </ui-form-group>
    <ui-form-group title="更大" contentui="justify-end">
        <ui-checkbox ui="round text-xl" value="{{size3}}" bind:change="size3Change">选项1</ui-checkbox>
        <ui-checkbox ui="text-xl" value="{{size4}}" bind:change="size4Change">选项2</ui-checkbox>
    </ui-form-group>
</ui-form>

禁用

<ui-form ui="ui-BG">
    <ui-form-group title="复选框" contentui="justify-end">
        <ui-checkbox disabled>选项</ui-checkbox>
    </ui-form-group>
</ui-form>

样式

<ui-form ui="ui-BG">
    <ui-form-group title="背景" contentui="justify-end">
        <ui-checkbox value="{{style1}}" unbg="borders border-red" bg="bg-red" bind:change="style1Change">红色</ui-checkbox>
        <ui-checkbox value="{{style2}}" unbg="borders border-blue" bg="bg-blue-gradient" bind:change="style2Change">渐变</ui-checkbox>
        <ui-checkbox value="{{style3}}" unbg="borders border-blue shadow-blue" bg="bg-blue shadow-blue" bind:change="style3Change">阴影</ui-checkbox>
        <ui-checkbox value="{{style4}}" unbg="border-red-thin border border-red shadow-red shadow-sm"
                     bg="bg-red-thin border border-red shadow-red shadow-sm" bind:change="style4Change">红框阴影</ui-checkbox>
    </ui-form-group>
    <ui-form-group title="未选中" contentui="justify-end">
        <ui-checkbox value="{{unstyle1}}" unbg="borders border-red" bg="bg-red" bind:change="unstyle1Change">红色</ui-checkbox>
        <ui-checkbox value="{{unstyle2}}" unbg="borders border-blue" bg="bg-blue-gradient" bind:change="unstyle2Change">渐变</ui-checkbox>
        <ui-checkbox value="{{unstyle3}}" unbg="borders border-blue shadow-blue" bg="bg-blue shadow-blue"
                     bind:change="unstyle3Change">阴影</ui-checkbox>
        <ui-checkbox value="{{unstyle4}}" unbg="border-red-thin border border-red shadow-red shadow-sm"
                     bg="bg-red-thin border border-red shadow-red shadow-sm" bind:change="unstyle4Change">红框阴影</ui-checkbox>
    </ui-form-group>
</ui-form>

使用group

<ui-form ui="ui-BG">
    <ui-form-group title="复选框" contentui="justify-end">
        <ui-checkbox-group bg="bg-green-gradient" value="{{group}}" bind:change="groupChange" bind:all="groupAllChange">
            <ui-checkbox indeterminate="{{isIndeterminate}}" value="{{isAllChecked}}" all>全选</ui-checkbox>
            <ui-checkbox value="1">选项1</ui-checkbox>
            <ui-checkbox value="2">选项2</ui-checkbox>
            <ui-checkbox value="3">选项3</ui-checkbox>
        </ui-checkbox-group>
    </ui-form-group>
</ui-form>

数据格式

modal1:false,
modal2:false,
size1:true,
size2:true,
size3:true,
size4:true,
style1:true,
style2:true,
style3:true,
style4:true,
unstyle1:false,
unstyle2:false,
unstyle3:false,
unstyle4:false,
group:['1'],
isAllChecked: false,
isIndeterminate: true

参数

ui-checkbox-group

参数类型可选值默认值说明
uiString--其它class样式
bgString-ui-BG-Main背景
valueString/Array--值
disabledBoolean-false禁用
bind:inputEvent--选择事件
bind:changeEvent--选择事件
bind:allEvent--全选事件

ui-checkbox

参数类型可选值默认值说明
uiString--其它class样式
bgString-ui-BG-Main背景
unbgString-borderss附加样式
valueString/Number/Boolean--值
disabledBoolean-false禁用
allBoolean-false全选功能
indeterminateBoolean-false全选状态
bind:inputEventlabel-事件
bind:changeEventlabel-事件

mp-cu

Prev
单选框 ui-radio
Next
开关 ui-switch