0.0.9 • Published 2 years ago

@mas.io/mas-indexed-list v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

tnpm install --save @alipay/mas-indexed-list

组件介绍

右侧带有快速选择的列表组件

参数说明

属性必填参数类型参数说明默认值示例
optionsarray索引列表数据[]-
anchorClassstring可设置右侧锚点样式''-
showThumbboolean是否展示左侧图标,默认不展示false-
showValueboolean是否展示右value值,默认展示true-
onItemClickfunction单击每一项的回调函数空函数-
hotIndexstring热门索引''-

Badges

TNPM version TNPM downloads install size


options每一项的的结构如下

属性必填参数类型参数说明默认值示例
letterstring索引值''-
dataarray每一项的数组[]-

options.data每一项的的结构如下

属性必填参数类型参数说明默认值示例
namestring每一项显示名称''-
valuestring每一项的值''-
iconstring每一项的logo''-
defaultIconstring每一项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"
  />