<template>
  <div id="page">
    <van-pagination v-model="currentPage" @change="changePage" :total-items="total" :items-per-page="limit" :show-page-size="5" force-ellipses />
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'page',
  props: {
    total: { type: Number },
    limit: { type: Number, default: () => 6 },
  },
  components: {},
  data: function() {
    return {
      currentPage: 1,
    };
  },
  created() {},
  methods: {
    changePage(page) {
      this.$emit('search', { skip: (page - 1) * this.limit });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped></style>
