~~~ <div id="app"></div> new Vue({ el: '#app', data: function() { return { page:1, limit:15, total:0, data:[], export_table_half:"" } }, created () { console.log("created"); this.getData(); }, updated(){ this.export_table_half = "/manager/order/static?limit="+this.limit+"&page="+this.page+"&export_excel=true" this.$nextTick(() => { this.$refs.table.doLayout() }) }, methods: { getData(){ let that = this let param = {'limit':that.limit,'page':that.page}; const loading = this.$loading({ lock: true, text: '加载中~~~', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); $.post("/manager/order/static",param,function (res) { that.data = res.data; that.total = res.total // console.log(res.data); loading.close(); }) }, handleSizeChange(val) { this.limit = val; this.getData(); }, handleCurrentChange(val) { this.page = val; this.getData(); }, getSummaries(param) { const {columns, data} = param; const sums = []; columns.forEach((column, index) => { if (index === 0) { sums[index] = '总计'; return; } const values = data.map(item => Number(item[column.property])); if( column.property === 'user_name' || column.property === 'order_id' || column.property === 'admin_type_title' || column.property === 'admin_username' || column.property === 'order_pay_mark' || column.property === 'user_id' ){ sums[index] = ''; }else{ sums[index] = values.reduce((prev, curr) => { const value = Number(curr); if (!isNaN(value)) { return prev + curr; } else { return prev; } }, 0); sums[index] += ' 元'; } }); console.log(sums); return sums; } } }); ~~~