Преглед изворни кода

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

疯狂的狮子Li пре 7 месеци
родитељ
комит
4c607f6915
1 измењених фајлова са 3 додато и 0 уклоњено
  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') {