uView IndexList 索引列表

通过折叠面板收纳内容区域

#平台差异说明

App(vue) App(nvue) H5 小程序

#基本使用

外层包裹一个index-list组件,锚点通过index-anchor组件传入,自定义列表内容通过index-item嵌套使用

  • nvue需要将index-anchor写在index-item的外部

  • 非nvue需要将index-anchor嵌套在index-item的内部

  • 可以通过index-list参数自定义索引字符列表

  • 需要监听页面的onPageScroll事件,将当前滚动条高度传入index-list组件

    <template> <u-index-list :index-list="indexList"> <template v-for="(item, index) in itemArr"> <u-index-anchor :text="indexList[index]"></u-index-anchor> <u-index-item> <u-index-anchor :text="indexList[index]"></u-index-anchor> <view class="list-cell" v-for="(cell, index) in item"> {{cell}} </view> </u-index-item> </template> </u-index-list> </template> <script> export default { data() { return { indexList: ["A", "B", "C"], itemArr: [ ['列表A1','列表A2','列表A3'], ['列表B1','列表B2','列表B3'], ['列表C1','列表C2','列表C3'] ] } } } </script> <style lang="scss" scoped> .list-cell { display: flex; box-sizing: border-box; width: 100%; padding: 10px 24rpx; overflow: hidden; color: #323233; font-size: 14px; line-height: 24px; background-color: #fff; } </style>
相关推荐
雨雨雨雨雨别下啦1 分钟前
Vue3——大事件管理系统1/3
前端·javascript·vue.js
头发多多程序媛3 分钟前
解决依赖下载报错,npm ERR! code EPERM
前端·npm·node.js
小蜜蜂dry4 分钟前
nestjs学习 - 拦截器(intercept)
前端·nestjs
daols885 分钟前
Vue表单vxe-form配置渲染日期范围选择器的用法
javascript·vue.js·vxe-form
CoderLiu8 分钟前
Agent 沙箱架构深度解析:从 Pattern 选型到生产级框架设计
前端·人工智能·后端
happymaker062610 分钟前
web前端学习日记——DAY02(CSS样式表的使用)
前端·css·学习
fanjinzhi18 分钟前
Node.js通用计算15--TypeScript介绍
javascript·typescript·node.js
数据服务生22 分钟前
五子棋-html版本
前端·html
BUG创建者25 分钟前
openlayers上跟据经纬度画出轨迹
开发语言·javascript·vue·html
IT_陈寒30 分钟前
SpringBoot项目启动速度提升300%?这5个隐藏配置太关键了!
前端·人工智能·后端