Parcourir la source

fix 修复 初始化用户选择组件 数据为空导致的问题

疯狂的狮子Li il y a 7 mois
Parent
commit
4c607f6915
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      src/components/UserSelect/index.vue

+ 3 - 0
src/components/UserSelect/index.vue

@@ -168,6 +168,9 @@ const confirm = () => {
 };
 
 const computedIds = (data) => {
+  if (data === '' || data === null || data === undefined) {
+    return [];
+  }
   if (data instanceof Array) {
     return data.map((item) => String(item));
   } else if (typeof data === 'string') {