Skip to content

Commit

Permalink
fix: 歌单详情搜索结果后改变id参数 重新获取歌单详情会显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1673495 committed Aug 7, 2019
1 parent 7df33ea commit b3e6e06
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/page/playlist-detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default {
async created() {
this.SONG_IDX = SONG_IDX
this.COMMENT_IDX = COMMENT_IDX
this.$watch('id', this.init, { immediate: true })
},
data() {
return {
Expand Down Expand Up @@ -120,6 +119,15 @@ export default {
return this.songs.filter(({ name, artistsText, albumName }) => `${name}${artistsText}${albumName}`.toLowerCase().includes(this.searchValue.toLowerCase()))
}
},
watch: {
id: {
handler() {
this.searchValue = ''
this.init()
},
immediate: true
},
},
components: { DetailHeader, SongTable, Comments }
}
</script>
Expand Down

0 comments on commit b3e6e06

Please sign in to comment.