Przeglądaj źródła

优化replaceNullWithEmpty函数逻辑

luoaoxuan 1 rok temu
rodzic
commit
30d05ec158
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/utils/common.js

+ 1 - 1
src/utils/common.js

@@ -140,7 +140,7 @@ export const getFormatDate = (type, length, date = new Date()) => {
  */
 export const replaceNullWithEmpty = obj => {
     function replaceValue (value) {
-        if (value === null) {
+        if (value === null || typeof value === 'undefined') {
             return ''
         } else if (typeof value === 'object') {
             if (Array.isArray(value)) {