import Vue from 'vue';
Vue.mixin({
data() {
return {
uploading: ''
}
},
methods: {
// 表格行背景色
tableRowClassName(row) {
// 表格行背景色
if (row.rowIndex % 2 == 1) {
return "warning-row";
} else {
return "success-row";
}
},
/**
* 表单重置
* @param {string} formName
*/
resetForm(formName) {
if (formName == 'selectForm') {
this.selectForm = this.$options.data().selectForm;
this.pageInfo.pageNum = 1;
this.getTableData();
} else if (formName == 'editorForm') {
this.editorForm = this.$options.data().editorForm;
}
},
// 头部表单查询
formSelect() {
this.pageInfo.pageNum = 1;
this.getTableData();
},
// 自定义序号
indexMethod(index) {
return (this.pageInfo.pageNum - 1) * this.pageInfo.pageSize + index + 1;
},
},
created() {}
})
需要用到mixin的页面引入该文件直接当本页面属性、或方法调用即可。