Explorar o código

优化replaceNullWithEmpty函数逻辑

luoaoxuan hai 1 ano
pai
achega
30d05ec158
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)) {