소스 검색

no message

xiaochan 2 년 전
부모
커밋
6be282571b
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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 '';
     }