移动开发平台 mPaaS 分页(pagination)

By | 2021年4月23日

本文介绍分页(pagination)。

属性名 类型 描述 默认值
mode String 按钮的形态可选类型:texticon text
total Number 总页数。 0
current Number 当前页数。 0
simple Boolean 是否隐藏数值。 false
disabled Boolean 禁用状态。 false
prevText String 前翻分页按钮文案。 上一页
nextText String 后翻分页按钮文案。 下一页
btnClass String 分页按钮样式,限于文字类型按钮。
onChange (index: Number) => void 翻页回调函数。

prevTextnextText 当且仅当 mode 为 text 时生效。

代码示例

  
  1. {
  2. "defaultTitle": "小程序 AntUI 组件库",
  3. "usingComponents": {
  4. "pagination": "mini-antui/es/pagination/index"
  5. }
  6. }
  
  1. <view>
  2. <view class="demo-title">基础用法</view>
  3. <pagination total="{{20}}" current="{{1}}"/>
  4. <view class="demo-title">箭头按钮</view>
  5. <pagination mode="icon" total="{{20}}" current="{{10}}"/>
  6. <view class="demo-title">简单模式</view>
  7. <pagination simple total="{{20}}" current="{{1}}"/>
  8. <view class="demo-title">按钮禁用</view>
  9. <pagination total="{{20}}" current="{{1}}" disabled/>
  10. <view class="demo-title">自定义按钮文案</view>
  11. <pagination arrow prevText="上一篇" nextText="下一篇" total="{{20}}" current="{{1}}"/>
  12. </view>
  
  1. Page({})

请关注公众号获取更多资料

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注