element-ui 分页组件没有效果

新手上路,请多包涵

分页组件在本地环境是有效果的

clipboard.png

但是打包到线上之后

clipboard.png

下面是我的部分代码:

data() {
    return {
        tops: {},
        news: {},
        hots: {},
        recommends: {},
        PageSize:null,
        totalPage:null,
        currentPage:null,
    }
},
        
        
mounted: function() {
    var that = this;
    this.$axios.get("/api/home/client?method=index").then(function(response) {
        response = response.data;
        that.tops = response.response.tops;
        that.news = response.response.news.data;
        that.hots = response.response.hots;
        that.recommends = response.response.recs;

        //分页数据
        that.currentPage = parseInt(response.response.news.currentPage);
        that.totalPage = parseInt(response.response.news.total);
        that.PageSize = parseInt(response.response.news.per_page);

    });

}
<!-- 分页组件 -->
<vue-paginate :PageSize='PageSize' :totalPage="totalPage" :currentPage="currentPage"></vue-paginate>

分页组件的代码:

props: {
    totalPage: {
        type: Number
    },
    PageSize: {
        type: Number
    },
    currentPage: {
        type: Number
    }

},
methods: {
    handleCurrentChange: function (val) {
        this.$router.push({path:this.$route.path,query:{page: val}});
    },
},
<el-pagination
        background
        layout="prev, pager, next"
        :total="totalPage"
        :page-size="PageSize"
        :currentPage="currentPage"
        @current-change="handleCurrentChange"
>
</el-pagination>

请问大佬们 线上环境这个分页为啥没效果了

阅读 4.2k
1 个回答

是不是线上的数据没有拿到?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题