shaogen1995 1 anno fa
parent
commit
16c1b4796d
1 ha cambiato i file con 10 aggiunte e 9 eliminazioni
  1. 10 9
      src/components/MyTable/index.tsx

+ 10 - 9
src/components/MyTable/index.tsx

@@ -96,15 +96,16 @@ function MyTable({
 
           if (tempCom.length >= v[3]) {
             tempCom = tempCom.substring(0, v[3]) + "...";
-            if (v[4]) {
-              tempCom = tableComObj(v[4], [tempCom, item[v[2]]]);
-            } else {
-              tempCom = (
-                <span style={{ cursor: "pointer" }} title={item[v[2]]}>
-                  {tempCom}
-                </span>
-              );
-            }
+          }
+
+          if (v[4]) {
+            tempCom = tableComObj(v[4], [tempCom, item[v[2]]]);
+          } else if (item[v[2]].length >= v[3]) {
+            tempCom = (
+              <span style={{ cursor: "pointer" }} title={item[v[2]]}>
+                {tempCom}
+              </span>
+            );
           }
 
           return tempCom;