瀏覽代碼

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 '';
     }