Skip to content

Commit

Permalink
feat: devops-select与select-input重复key问题 issue TencentBlueKing#8125
Browse files Browse the repository at this point in the history
  • Loading branch information
lockiechen committed Jun 3, 2024
1 parent 6f058cd commit 0b31f85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ul>
<template v-if="hasGroup">
<li v-for="(item, index) in filteredList"
:key="item.id"
:key="item.id + index"
:disabled="item.disabled">
<div class="option-group-name">{{ item.name }}</div>
<div class="option-group-item"
Expand All @@ -41,7 +41,7 @@
<template v-else>
<li
v-for="(item, index) in filteredList"
:key="item.id"
:key="item.id + index"
:class="{
'option-item': true,
active: item.active,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ul>
<template v-if="hasGroup">
<li v-for="(item, index) in filteredList"
:key="item.id"
:key="item.id + index"
:disabled="item.disabled">
<div class="option-group-name">{{ item.name }}</div>
<div class="option-group-item"
Expand All @@ -22,7 +22,16 @@
</li>
</template>
<template v-else>
<li class="option-item" v-for="(item, index) in filteredList" :key="item.id" :class="{ active: item.id === value, selected: selectedPointer === index }" :disabled="item.disabled" @click.stop="selectOption(item)" @mouseover="setSelectPointer(index)" :title="item.name">
<li
v-for="(item, index) in filteredList"
class="option-item"
:key="item.id + index"
:class="{ active: item.id === value, selected: selectedPointer === index }"
:disabled="item.disabled"
@click.stop="selectOption(item)"
@mouseover="setSelectPointer(index)"
:title="item.name"
>
{{ item.name }}
</li>
</template>
Expand Down

0 comments on commit 0b31f85

Please sign in to comment.