Explorar o código

update Web/src/components/table/index.vue.
修正对象为空时的错误提示

Signed-off-by: inypeacock <1300856@qq.com>

inypeacock %!s(int64=2) %!d(string=hai) anos
pai
achega
47a051862f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Web/src/components/table/index.vue

+ 2 - 2
Web/src/components/table/index.vue

@@ -313,13 +313,13 @@ const handleList = async () => {
 	Object.keys(param).forEach((key) => !param[key] && delete param[key]);
 	const res = await props.getData(param);
 	state.loading = false;
-	if (res.result && res.result.items) {
+	if (res && res.result && res.result.items) {
 		state.showPagination = true;
 		state.data = res.result?.items ?? [];
 		state.total = res.result?.total ?? 0;
 	} else {
 		state.showPagination = false;
-		state.data = res.result ?? [];
+		state.data = (res && res.result) ? res.result : [];
 	}
 };