|
@@ -0,0 +1,53 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="c-page">
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ layout="total, prev, pager, next"
|
|
|
|
+ :page-sizes="[10, 50, 100, 150, 200]"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page-size="limit"
|
|
|
|
+ :current-page.sync="currentPage"
|
|
|
|
+ @current-change="changePage"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+export default {
|
|
|
|
+ name: 'c-page',
|
|
|
|
+ props: {
|
|
|
|
+ total: { type: Number },
|
|
|
|
+ limit: { type: Number, default: 10 },
|
|
|
|
+ },
|
|
|
|
+ components: {},
|
|
|
|
+ data: function () {
|
|
|
|
+ return {
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {},
|
|
|
|
+ methods: {
|
|
|
|
+ changePage(page = this.currentPage) {
|
|
|
|
+ this.$emit('query', { skip: (page - 1) * this.limit, limit: this.limit, ...this.searchInfo });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ test: {
|
|
|
|
+ deep: true,
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler(val) {},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|
|
|
|
+G
|