Browse Source

no message

xiaochan 2 năm trước cách đây
mục cha
commit
6be282571b
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      src/utils/find-name-by-list-code.ts

+ 5 - 2
src/utils/find-name-by-list-code.ts

@@ -7,13 +7,17 @@ interface Option {
     listValue: string
 }
 
-const defaultValue: Option = {listCode: 'code', listValue: 'name'}
+const defaultValue: Option = {
+    listCode: 'code',
+    listValue: 'name'
+}
 
 /**
  *
  * @param arr 数组
  * @param code 需要寻找的值
  * @param option  配置
+ * @return str {string} name
  */
 const findValueByListCode = (arr: any[] | object, code: string | number, option: Option = defaultValue): string => {
     const {listCode, listValue} = option
@@ -25,7 +29,6 @@ const findValueByListCode = (arr: any[] | object, code: string | number, option:
         return '';
     }
 
-
     if (typeof code === 'undefined' || code === null) {
         return '';
     }