From 3171a705a031a124e0d6ac44ff0cc8cc95cca50d Mon Sep 17 00:00:00 2001 From: LiuJiaNan Date: Sun, 7 Apr 2024 15:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9useListData=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/useListData.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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,