Skip to content

Commit

Permalink
fix(tracklist): TrackListItem 序号问题 (#2011)
Browse files Browse the repository at this point in the history
直接使用 track.no 可能导致歌曲编号重复。改使用曲目在
阵列中的实际索引位置。
  • Loading branch information
Younglina committed Apr 8, 2023
1 parent 7b97ac0 commit 8a50337
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/TrackList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
v-for="(track, index) in tracks"
:key="itemKey === 'id' ? track.id : `${track.id}${index}`"
:track-prop="track"
:track-no="index + 1"
:highlight-playing-track="highlightPlayingTrack"
@dblclick.native="playThisList(track.id || track.songId)"
@click.right.native="openMenu($event, track, index)"
Expand Down
3 changes: 2 additions & 1 deletion src/components/TrackListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
style="height: 14px; width: 14px"
></svg-icon>
</button>
<span v-show="(!focus || !playable) && !isPlaying">{{ track.no }}</span>
<span v-show="(!focus || !playable) && !isPlaying">{{ trackNo }}</span>
<button v-show="isPlaying">
<svg-icon
icon-class="volume"
Expand Down Expand Up @@ -96,6 +96,7 @@ export default {
props: {
trackProp: Object,

Check warning on line 98 in src/components/TrackListItem.vue

View workflow job for this annotation

GitHub Actions / release (macos-latest)

Prop 'trackProp' requires default value to be set

Check warning on line 98 in src/components/TrackListItem.vue

View workflow job for this annotation

GitHub Actions / release (windows-latest)

Prop 'trackProp' requires default value to be set
trackNo: Number,

Check warning on line 99 in src/components/TrackListItem.vue

View workflow job for this annotation

GitHub Actions / release (macos-latest)

Prop 'trackNo' requires default value to be set

Check warning on line 99 in src/components/TrackListItem.vue

View workflow job for this annotation

GitHub Actions / release (windows-latest)

Prop 'trackNo' requires default value to be set
highlightPlayingTrack: {
type: Boolean,
default: true,
Expand Down
4 changes: 1 addition & 3 deletions src/views/album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@
{{ $t('album.released') }}
{{ album.publishTime | formatDate('MMMM D, YYYY') }}
</div>
<div v-if="album.company" class="copyright">
© {{ album.company }}
</div>
<div v-if="album.company" class="copyright"> © {{ album.company }} </div>
</div>
<div v-if="filteredMoreAlbums.length !== 0" class="more-by">
<div class="section-title">
Expand Down

0 comments on commit 8a50337

Please sign in to comment.