Skip to content

Commit e95e953

Browse files
committed
[date-picker] add key prop to 'v-for'
1 parent dd4a496 commit e95e953

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/date-picker/src/basic/time-spinner.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
@click="handleClick('hours', { value: hour, disabled: disabled })"
1515
v-for="(disabled, hour) in hoursList"
1616
class="el-time-spinner__item"
17+
:key="hour"
1718
:class="{ 'active': hour === hours, 'disabled': disabled }">{{ ('0' + (amPmMode ? (hour % 12 || 12) : hour )).slice(-2) }}{{ amPm(hour) }}</li>
1819
</el-scrollbar>
1920
<el-scrollbar
@@ -28,6 +29,7 @@
2829
<li
2930
@click="handleClick('minutes', { value: key, disabled: false })"
3031
v-for="(enabled, key) in minutesList"
32+
:key="key"
3133
class="el-time-spinner__item"
3234
:class="{ 'active': key === minutes, disabled: !enabled }">{{ ('0' + key).slice(-2) }}</li>
3335
</el-scrollbar>

packages/date-picker/src/panel/time-select.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
v-for="item in items"
1212
:class="{ selected: value === item.value, disabled: item.disabled, default: item.value === defaultValue }"
1313
:disabled="item.disabled"
14+
:key="item.value"
1415
@click="handleClick(item)">{{ item.value }}</div>
1516
</el-scrollbar>
1617
</div>

0 commit comments

Comments
 (0)