深色模式
全局配置
我们为部分组件提供了一些自定义扩展配置选项,用于使组件行为或特性更加符合被引用项目的规范
全局分页数据格式化
由于不同的项目中分页 API 返回的数据格式可能有所不同,当前组件库中默认的分页数据格式如下
ts
interface IPageApiResData {
currentPage: number; // 当前页码
pageSize: number; // 每页记录数
total: number; // 总记录数
records: object[]; // 当前页数据
}1
2
3
4
5
6
2
3
4
5
6
因此,当您的项目中分页数据字段与下表不符时,您可以使用 pageFieldsMap 自定义映射字段
使用示例:分页数据格式为 { current: number, pageSize: number, total: number, rows: object[] }
js
import { createApp } from "vue";
import ElementPlusPro from "@easyui/element-plus-pro";
import "@easyui/element-plus-pro/theme/index.css";
import App from "./App.vue";
const app = createApp(App);
app.use(ElementPlusPro, {
pageFieldsMap: {
currentPage: "current",
records: "rows"
}
});
app.mount("#app");1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13