# next-indexed-xlist适用于uni-app项目的通讯录、城市、地址索引列表组件 ### 本组件目前兼容微信小程序、H5 app ### 本组件是通讯录、城市、地址索引列表组件,自带搜索功能,可自定义显示字段,用于通讯录列表、城市列表、地址列表等 > 遇到问题或有建议可以加入QQ群(455948571)反馈; > 如果觉得组件不错,给五星鼓励鼓励咯; > > 本插件居于npmjs开源包[js-pinyin](https://www.npmjs.com/package/js-pinyin) 进行开发,详细插件功能可以到npm上进行查看; ### 如果有使用问题请加群 注意:如果插件问题,请务必给一个完整的复现demo,谢谢配合; [点击链接加入群聊前端开发(uniapp插件)】](https://qm.qq.com/q/S1bJzQfJAG) ### 使用示例 ``` html ``` ### vue3使用 ``` ts ``` ### vue2使用 ``` ts export default { data () { return { dataList: [{ id: '1', name: '刘**', phone: '181****5576', img: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=300&h=300' }, { id: '2', name: '王**', phone: '181****5576', img: 'https://img1.baidu.com/it/u=1016138010,1907110459&fm=253&fmt=auto&app=138&f=JPEG?w=300&h=300' }, { id: '3', name: '黎**', phone: '181****5576', img: 'https://img2.baidu.com/it/u=453253244,3693084626&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500' }, { id: '4', name: '王**', phone: '181****5576', img: 'https://img2.baidu.com/it/u=453253244,3693084626&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500' }] } }, methods: { itemclick(e) { console.log('点击列表回调:', e) } } } ``` ### 属性说明 | 名称 | 类型 | 默认值 | 描述 | | ----------------------------|--------------- | ---------------------- | ----------------------| | dataList | Array | [] | 数据源 | | idKey | String | id | 显示的主键key值 | | nameKey | String | name | 显示的名字key值 | | phoneKey | String | phone | 显示的电话key值 | | imgKey | String | img | 显示的头像key值 | | radius | Number | 4rpx | 头像圆角(rpx、px、%) | | showAvatar | Boolean | true | 是否显示头像 | | isInterlock | Boolean | false | 是否双向联动 | ## Event 事件 |事件名 |说明 |类型 |回调参数 | |---- |---- |---- |---- | |itemclick|菜单项item点击事件 |emit |Object | ### 微信小程序在线体验 ![](https://lixueshiaa.github.io/webtest/www/static/img/ponder_next.png) ### 预览 *** | (通信录演示效果) | (地区选择演示效果) | | :-----------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | | ![](https://lixueshiaa.github.io/webtest/www/static/next-indexed-list-a.gif) | ![](https://lixueshiaa.github.io/webtest/www/static/next-indexed-list-b.gif) |