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