前言
tableBase.js
说说vue2中minxin的用法 大概就是这个样子
export const tableBaseMixin = {
data() {
return {
page: {
current: 1,
size: 10,
total: 0, // 总页数
currentPage: 1, // 当前页数
pageSize: 10 // 每页显示多少条
},
selectionData: [],
tableData: [],
listLoading: false,
searchQuery: {},
pageQuery: {
current: 1,
size: 10
},
downLoadUrl: {
downLoadUrl: '',
excelName: ''
},
}
},
created() {
},
methods: {
async doExportRequest(exportParams) {
const response = await this.exportRequest(exportParams.url, exportParams.method || 'get', exportParams.params)
const {
status,
data,
statusText
} = response
if (status === 200) {
this.downloadFile(data, exportParams