瀏覽代碼

优化replaceNullWithEmpty函数逻辑

luoaoxuan 1 年之前
父節點
當前提交
281ef967e0
共有 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)) {