Yb-components Yb-components
首页
开发规范
yb-cli
  • 开发指南
  • 更新日志
  • 组件
关于
首页
开发规范
yb-cli
  • 开发指南
  • 更新日志
  • 组件
关于
  • 开发指南
  • 更新日志
  • 数据展示

    • YbTable 表格
    • YbCardList 卡片列表
    • YbTree 树
    • YbCascaderList 级联列表
    • YbSimpleTablePage 分页查询表格
    • YbSimpleCardPage 分页卡片列表
    • YbBasicProfile 基础详情数据展示
    • YbOutscrollLayout 固定在滚动区域外
    • YbOutscrollTree 固定在滚动区域外的Tree
    • YbInfoLayout 信息页布局
    • YbEditLayout 编辑页布局
  • 数据录入

    • YbRowsPopoverForm 浮层多行表单
    • YbFormily 配置式表单
    • YbForm 表单
    • YbRowsForm 多行表单
    • YbCollapseForm 折叠表单
    • YbQueryFilter 筛选表单
    • YbFilesSelect 文件选择器
    • YbRangeWrapper 范围结构
    • YbRangeDatepicker 日期范围
    • YbRange 范围
    • YbFormulaInput 简单运算公式输入
    • YbCron 表达式生成器
    • YbTreeSelect 树型选择器
    • YbInputgroupWrapper 复合组
    • YbThemeSelect 主题风格选择器
    • YbSelect 选择器
    • YbPaginationSelect 分页选择器
    • YbCodemirror 代码编辑器
    • YbCodemirrorSql SQL编辑器
    • YbCodemirrorJson JSON编辑器
    • YbCodemirrorXml XML编辑器
    • YbCombiDatepicker 组合时间
    • YbQuarterPicker 季度选择器
    • YbRangeQuarterPicker 季度范围选择器
    • YbConditionSelect 条件选择器
    • YbCheckboxGroup 多选框组
      • YbIconSelect 选择器
      • YbTagsInput 标签输入框
    • 其他组件

      • YbBallLoading 加载中
      • YbSymbolIcon 多色小图标
      • YbKeybuttonsPopover
      • YbPercentBattery 电池百分比
      • YbAffix 固钉
      • YbPagination 分页器
      • YbCollapse 折叠面板
      • YbScrollTool 滚动工具
    • 物料

      • YbMainSideMenu 侧栏菜单
      • YbLoadRemote 远程应用加载
      • YbLayoutPro 布局
      • YbMainPro 主页
      • YbAppMain 应用主页
      • YbAppLogin 普通登录页
      • YbAppPortal Portal登录页
    • 指令

      • v-fixed-in-scroller
    • Mixins

      • pageList_mixin
      • getScopedSlot_mixin
      • editFormPage_mixin
      • uploadProgressPage_mixin
      • rowActions_mixin
      • rowDeletes_mixin
      • drawerToRouterTab_mixin
    • 实验室

      • YbSwiper 轮播
    • 组件
    • 数据录入
    liaoyingmin
    2024-06-28

    YbCheckboxGroup 多选框组

    在 el-checkbox-group (opens new window) 基础功能上扩展,不仅支持 el-checkbox-group 的所有功能,增加了全选等

    # 基本使用

    • options:复选框选项数据,当存在插槽时,该属性不生效
    编辑JSON
    <template>
        <yb-codemirror-json v-model="valueString"></yb-codemirror-json>
        <yb-checkbox-group v-model="value">
            <el-checkbox v-for="city in cities" :label="city" :key="city">
                {{ city }}
            </el-checkbox>
        </yb-checkbox-group>
        <el-divider content-position="left"> </el-divider>
        <yb-checkbox-group v-model="value" :options="cities" type="button">
        </yb-checkbox-group>
    </template>
    <script>
        export default {
            data() {
                return {
                    cities: ['上海', '北京', '广州', '深圳'],
                    value: [],
                };
            },
            computed: {
                valueString() {
                    return JSON.stringify(this.value);
                },
            },
        };
    </script>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    显示 复制 复制

    # 其他属性

    new 新增属性
    type
    isShowSelectAll
    el-checkbox-group 属性
    disabled
    border
    max
    以下属性 type 为 button 时生效
    size
    fill
    hex
    r
    g
    b
    textColor
    hex
    r
    g
    b
    <template>
        <el-row :gutter="20">
            <el-col :span="10">
                <el-divider content-position="left">
                    <el-tag type="danger">new</el-tag> 新增属性
                </el-divider>
                <div style="margin-bottom:20px">
                    type
                    <el-radio-group v-model="otherProps['type']" size="mini">
                        <el-radio-button label="text">text</el-radio-button>
                        <el-radio-button label="button">button</el-radio-button>
                    </el-radio-group>
                </div>
                <div style="margin-bottom:20px">
                    isShowSelectAll
                    <el-switch v-model="otherProps['isShowSelectAll']"></el-switch>
                </div>
                <el-divider content-position="left">
                    el-checkbox-group 属性
                </el-divider>
                <div style="margin-bottom:20px">
                    disabled
                    <el-switch v-model="otherProps['disabled']"></el-switch>
                </div>
                <div style="margin-bottom:20px">
                    border
                    <el-switch v-model="otherProps['border']"></el-switch>
                </div>
                <div style="margin-bottom:20px">
                    max
                    <el-input-number
                        v-model="otherProps['max']"
                        :min="0"
                        :max="10"
                        size="mini"
                    />
                </div>
    
                <el-divider content-position="left">
                    以下属性 type 为 button 时生效
                </el-divider>
                <div style="margin-bottom:20px">
                    size
                    <el-radio-group v-model="otherProps['size']" size="mini">
                        <el-radio-button label="medium">medium</el-radio-button>
                        <el-radio-button label="small">small</el-radio-button>
                        <el-radio-button label="mini">mini</el-radio-button>
                    </el-radio-group>
                </div>
                <div style="margin-bottom:20px;display:flex;align-items:center">
                    fill
                    <el-color-picker
                        v-model="otherProps['fill']"
                        size="mini"
                        style="margin-left:10px"
                    >
                    </el-color-picker>
                </div>
                <div style="margin-bottom:20px;display:flex;align-items:center">
                    textColor
                    <el-color-picker
                        v-model="otherProps['textColor']"
                        size="mini"
                        style="margin-left:10px"
                    >
                    </el-color-picker>
                </div>
            </el-col>
            <el-col :span="12">
                <yb-checkbox-group
                    v-model="value"
                    :options="options"
                    v-bind="otherProps"
                />
            </el-col>
        </el-row>
    </template>
    <script>
        export default {
            data() {
                return {
                    value: [],
                    otherProps: {
                        size: 'small',
                        type: 'text',
                        fill: '#62B0C1',
                        textColor: '#ffffff',
                        isShowSelectAll: true,
                    },
                    options: [
                        { value: '黄金糕', label: '黄金糕', disabled: true },
                        { value: '双皮奶', label: '双皮奶' },
                        { value: '蚵仔煎', label: '蚵仔煎' },
                        { value: '龙须面', label: '龙须面' },
                    ],
                };
            },
        };
    </script>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    显示 复制 复制

    # YbCheckboxGroup Attributes

    参数 说明 类型 可选值 默认值
    options 复选框选项数据,优先级低于插槽 array -- --
    isShowSelectAll 是否显示全选 boolean -- true
    type 选项样式 string 'button'/'text' 'text'
    -- 其他属性同 el-checkbox-group (opens new window) -- -- --

    # YbCheckboxGroup Options

    同el-checkbox (opens new window) 同el-checkbox-button (opens new window)

    # YbCheckboxGroup Events

    同el-checkbox-group Events (opens new window)

    上次更新: 2024/06/28, 18:11:17
    YbConditionSelect 条件选择器
    YbIconSelect 选择器

    ← YbConditionSelect 条件选择器 YbIconSelect 选择器→

    Theme by Vdoing | Copyright © 2021-2025 YB-GZ | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式