diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 4c176b5..9127d6b 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -70,6 +70,7 @@ export default { else this.$router.go(1); }, goToSearchPage() { + if(!this.keywords) return; this.$router.push({ name: "search", query: { keywords: this.keywords }, diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index 985f736..28cdc98 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -82,5 +82,13 @@ export default { }, modal: { close: "Close" + }, + search: { + artist: "Artists", + album: "Albums", + song: "Songs", + mv: "MVs", + playlist: "Playlists", + noResult: "No Results" } }; diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index d9fd2f6..fd2ee5c 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -87,5 +87,13 @@ export default { }, modal: { close: "关闭" + }, + search: { + artist: "歌手", + album: "专辑", + song: "歌曲", + mv: "视频", + playlist: "歌单", + noResult: "暂无结果" } }; diff --git a/src/views/search.vue b/src/views/search.vue index 9065179..9ff1e83 100644 --- a/src/views/search.vue +++ b/src/views/search.vue @@ -1,10 +1,10 @@ @@ -150,7 +150,10 @@ export default { tracks() { let tracks = this.result.song.songs.slice(0, 12); return tracks; - } + }, + isExistResult() { + return Object.keys(this.result).length; + } }, methods: { goToAlbum(id) {