Browse Source

加?否则存在可能报错

lifanagju_citu 10 tháng trước cách đây
mục cha
commit
19ca889d44
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/utils/position.js

+ 1 - 1
src/utils/position.js

@@ -60,7 +60,7 @@ export const dealDictObjData = (res, obj) => {
     if (!data) return
     const valueKey = data.nameKey ? data.nameKey : 'label'
     const idKey = data.valueKey ? data.valueKey : 'value'
-    const result = dictObj[data.value].find(val => val[idKey] === obj[e])
+    const result = dictObj[data.value]?.find(val => val[idKey] === obj[e])
     if (!result) return
     res[data.label] = result[valueKey]
     res = { ...obj, ...res }