Browse Source

下拉框

xiaochan 1 month ago
parent
commit
238bd71fe6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/components/xiao-chan/select/XcSelect.vue

+ 4 - 2
src/components/xiao-chan/select/XcSelect.vue

@@ -95,8 +95,10 @@ const colorList = {
 
 const changeStaff = value => {
   const find = props.data.find(i => i.code === value);
-  props.modelValue[props.name[0]] = find[props.keys[0]];
-  props.modelValue[props.name[1]] = find[props.keys[1]];
+  if (find) {
+    props.modelValue[props.name[0]] = find[props.keys[0]];
+    props.modelValue[props.name[1]] = find[props.keys[1]];
+  }
   emit("change", find);
 };