0.0.9 • Published 2 years ago
@mas.io/mas-indexed-list v0.0.9
安装
tnpm install --save @alipay/mas-indexed-list
组件介绍
右侧带有快速选择的列表组件
参数说明
属性 | 必填 | 参数类型 | 参数说明 | 默认值 | 示例 |
---|---|---|---|---|---|
options | 是 | array | 索引列表数据 | [] | - |
anchorClass | 否 | string | 可设置右侧锚点样式 | '' | - |
showThumb | 否 | boolean | 是否展示左侧图标,默认不展示 | false | - |
showValue | 否 | boolean | 是否展示右value值,默认展示 | true | - |
onItemClick | 否 | function | 单击每一项的回调函数 | 空函数 | - |
hotIndex | 否 | string | 热门索引 | '' | - |
Badges
options每一项的的结构如下
属性 | 必填 | 参数类型 | 参数说明 | 默认值 | 示例 |
---|---|---|---|---|---|
letter | 是 | string | 索引值 | '' | - |
data | 是 | array | 每一项的数组 | [] | - |
options.data每一项的的结构如下
属性 | 必填 | 参数类型 | 参数说明 | 默认值 | 示例 |
---|---|---|---|---|---|
name | 是 | string | 每一项显示名称 | '' | - |
value | 是 | string | 每一项的值 | '' | - |
icon | 否 | string | 每一项的logo | '' | - |
defaultIcon | 否 | string | 每一项logo默认图片 | '' | - |
slot
name | 说明 |
---|---|
hot | 顶部插槽,可用于自定义header,当hotIndex设置时生效 |
options: 数据内容,数据结构为
[
{
letter: 'A',
data: [
{
name: '阿富汗',
value: 'AFH',
icon: 'https://gw.alipayobjects.com/mdn/rms_2ece3b/afts/img/A*TEK1RoULNGMAAAAAAAAAAABkARQnAQ',
defaultIcon: 'https://img.alicdn.com/imgextra/i4/2200637533148/O1CN01dCeM8t1Z7pMIRvsPx_!!2200637533148-2-tmallcaradmin.png',
}
....
]
}
...
]
在小程序中使用
{
"usingComponents": {
"mas-indexed-list": "@alipay/mas-indexed-list/es/index"
}
}
调用方式
<mas-indexed-list
options="{{ options }}"
showSelect="{{ false }}"
showThumb="{{ false }}"
showValue="{{ true }}"
anchorClass=""
className=""
onItemClick="onItemClick"
/>
0.0.9
2 years ago