Skip to content

Commit

Permalink
fix(select): 修复select新增选项,删除一个,其他新增的选项全部被删除了 #1274
Browse files Browse the repository at this point in the history
  • Loading branch information
handsomezyw authored and kagol committed Sep 5, 2022
1 parent 9bf02df commit 5791b1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/devui-vue/devui/select/src/use-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function useSelect(
const newOption = {
name: value,
value: value,
_checked: false,
_checked: true,
};
return value ? newOption : option;
} else {
Expand Down Expand Up @@ -236,7 +236,7 @@ export default function useSelect(
const tagDelete = (data: OptionObjectItem) => {
let { modelValue } = props;
const checkedItems = [];
for (const child of injectOptions.value.values()) {
for (const child of selectedOptions.value) {
if (data.value === child.value) {
child._checked = false;
}
Expand Down

0 comments on commit 5791b1c

Please sign in to comment.