更新记录

1.2.5(2020-09-09)

兼容支付宝小程序

1.2.4(2020-08-26)

修改初始化从后台拿到数据赋值失败

1.2.3(2020-08-26)

代码重构

查看更多

平台兼容性

使用方法

在script引用组件

import paging from '@/components/yang-paging/yang-paging.vue'
components: {
       paging
}

在template中使用组件

    <paging :total="total" :pageSize='3' v-model="curren" @changes="dd"></paging>

完整示例

<template>
    <view class="content">
        <view class="title margin-top">
            自定义配置
        </view>
        <paging :total="total" :pageSize='3' v-model="curren" @changes="dd"></paging>
        <view class="title margin-top">
            去掉上下分页 arrow:false
        </view>
        <paging :total="total" :pageSize='3' v-model="curren" :arrow="false" @changes="dd"></paging>
        <view class="title margin-top">
            去掉首页最后一页 first:false
        </view>
        <paging :total="total" :pageSize='3' :first="false" v-model="curren" @changes="dd">
            <template slot="arrow-left">
                <uni-icons type="arrowleft" size="15" color="#fff"></uni-icons>
            </template>
            <template slot="arrow-right">
                <uni-icons type="arrowright" size="15" color="#fff"></uni-icons>
            </template>
        </paging>
        <view class="title margin-top">
            自定义圆角度
        </view>
        <paging :total="total" :pageSize='3' :radius="5" v-model="curren" :arrow="false" @changes="dd"></paging>
        <view class="title margin-top">
            自定义颜色
        </view>
        <paging :total="total" :pageSize='3' background="#d4d4d4" color="#000000" activecolor="#ffffff" activebackground="linear-gradient(to right, #2193b0, #6dd5ed)"
         :first="false" v-model="curren" @changes="dd">
            <template slot="arrow-left">
                <uni-icons type="arrowleft" size="15" color="#000000"></uni-icons>
            </template>
            <template slot="arrow-right">
                <uni-icons type="arrowright" size="15" color="#000000"></uni-icons>
            </template>
        </paging>
        <button class="margin-top" type="primary" @click="dw()">点我切换总条数</button>
        <button class="margin-top" type="primary" @click="curren = 10">跳转到第10页</button>
    </view>
</template>

<script>
    import uniIcons from "@/components/uni-icons/uni-icons.vue"
    import paging from '@/components/yang-paging/yang-paging.vue'
    export default {
        components: {
            paging,
            uniIcons
        },
        data() {
            return {
                total: 300,
                curren: 1
            }
        },
        methods: {
            dd(index) {
                this.curren = index
            },
            dw() {
                this.total = 100
            },
        }
    }
</script>

<style>
    .title {
        font-size: 14px;
        line-height: 80rpx;
        color: #000;
        padding-left: 40rpx;
        text-align: center;
    }

    .margin-top {
        margin-top: 10px;
    }
</style>

paging 属性说明

属性名 类型 默认值 详细说明
total Number 0 总条数
pageSize Number 0 每页数据
v-mode Number 1 当前页
footer Boolean false 详细信息
background String #00BFFF 默认背景颜色
color String #ffffff 默认字体颜色
activebackground String linear-gradient(to right, #12c2e9, #c471ed, #f64f59) 选中背景颜色
activecolor String #ffffff 选中字体颜色

slot

属性名 详细说明
arrow-left 上一页内容(自定义图标文字等)
arrow-right 下一页内容(自定义图标文字等)

事件说明

事件名 说明
@changes 返回点击的页数

End

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问