类目选择器

多级类目选择器,选择更方便

效果预览

yml配置

- model: category
  label: 类目选择器
  append_html: '{%testHtml%}' #补充的html或者文字
  validate:
    required: required
  url: '/platform/category/get_category'
  data:
    - {name: category1,placeholder: 选择一级}
    - {name: category2,placeholder: 选择二级}
    - {name: category3,placeholder: 选择三级}

字段说明

category

字段 类型 含义 默认值
model String 该控件类型为category -
label String 控件label名称 -
data Array 类目选择器 -
readonly Boolean 是否只读,true为只读 flase
append_html String 补充的html或者文字 -
validate Object 校验规则,配置参考输入框-validate -
url String 获取类目数据异步接口 -

category.data

字段 类型 含义 默认值
name String 名称 -
placeholder String 占位提示 -
value String 选中值 -

url返回值结构示例

{
    "ret": 0,
    "msg": "OK",
    "errorcode": 0,
    "data": [{
        "name": "企业",
        "children": [{
            "name": "电商/团购",
            "children": [{
                "name": "团购",
                "value": "2"
            }, {
                "name": "海淘",
                "value": "3"
            }, {
                "name": "线上商超",
                "value": "203"
            }]
        }]
    }, {
        "name": "个体工商户",
        "children": [{
            "name": "生活/家居",
            "children": [{
                "name": "户外/运动/健身器材/安防",
                "value": "116"
            }]
        }]
    }, {
        "name": "事业单位",
        "children": [{
            "name": "教育/培训",
            "children": [{
                "name": "公立院校",
                "value": "164"
            }]
        }, {
            "name": "其他生活缴费",
            "children": [{
                "name": "水电煤缴费/交通罚款等生活缴费",
                "value": "165"
            }]
        }, {
            "name": "医疗",
            "children": [{
                "name": "公立医院",
                "value": "176"
            }, {
                "name": "挂号平台",
                "value": "177"
            }]
        }]
    }]
}

results matching ""

    No results matching ""