All files / src/components/search SearchSongLists.vue

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47                                                                                             
<template>
  <div class="search-song-Lists">
    <content-list :contentList="albumDatas"></content-list>
  </div>
</template>
 
<script>
import ContentList from '../ContentList'
import api from '../../api/index'
 
export default {
  name: 'search-song-Lists',
  components: {
    ContentList
  },
  data () {
    return {
      albumDatas: []
    }
  },
  mounted () {
    this.getSearchList()
  },
  methods: {
    getSearchList () {
      if (!this.$route.query.keywords) {
        this.notify('您输入内容为空', 'warning')
      } else if (this.$route.query.keywords) {
        api.songListAPI.getSongListOfLikeTitle(this.$route.query.keywords)
          .then(res => {
            this.albumDatas = res.data
          })
      } else {
        this.notify('暂无该歌曲内容', 'error')
      }
    }
  }
}
</script>
 
<style scoped>
.search-song-Lists{
  min-height: 300px;
  margin-top: 50px;
}
</style>