Browse Source

fix UI bug

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
21028cb2f8

+ 1 - 1
client/src/pages/databases/collections/data/CollectionData.tsx

@@ -417,7 +417,7 @@ const CollectionData = (props: CollectionDataProps) => {
                 },
                 field: i,
                 getStyle: d => {
-                  if (!d.field) {
+                  if (!d || !d.field) {
                     return {};
                   }
                   return {

+ 3 - 3
client/src/pages/databases/collections/search/Search.tsx

@@ -258,6 +258,9 @@ const Search = (props: CollectionDataProps) => {
               needCopy: key !== 'score',
               field: field,
               getStyle: d => {
+                if (!d || !d.field) {
+                  return {};
+                }
                 if (d.id === 'score') {
                   return {
                     minWidth: 180,
@@ -268,9 +271,6 @@ const Search = (props: CollectionDataProps) => {
                     minWidth: 180,
                   };
                 }
-                if (!d.field) {
-                  return {};
-                }
                 return {
                   minWidth: getColumnWidth(d.field),
                 };