修改useListData函数签名

dev
LiuJiaNan 2024-04-07 15:04:03 +08:00
parent c57edc5b22
commit 3171a705a0
1 changed files with 2 additions and 6 deletions

View File

@ -40,17 +40,13 @@ export default function useListData(api, options = {}) {
getDataType(options.clearSelection) !== "Boolean" getDataType(options.clearSelection) !== "Boolean"
) )
throw new Error("options.clearSelection必须是一个布尔值"); throw new Error("options.clearSelection必须是一个布尔值");
if (options.otherParams && getDataType(options.otherParams) !== "Object")
throw new Error("options.otherParams必须是一个对象");
const immediate = options.immediate ?? true; const immediate = options.immediate ?? true;
const usePagination = options.usePagination ?? true; const usePagination = options.usePagination ?? true;
const key = options.key ?? "varList"; const key = options.key ?? "varList";
const defaultSearchForm = options.defaultSearchForm ?? {}; const defaultSearchForm = options.defaultSearchForm ?? {};
const clearSelection = options.clearSelection ?? true; const clearSelection = options.clearSelection ?? true;
if (
immediate &&
options.otherParams &&
getDataType(options.otherParams) !== "Object"
)
throw new Error("options.otherParams必须是一个对象");
const list = ref([]); const list = ref([]);
const pagination = ref({ const pagination = ref({
currentPage: 1, currentPage: 1,