소스 검색

优化replaceNullWithEmpty函数逻辑

luoaoxuan 1 년 전
부모
커밋
70f8e2145f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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)) {