feat: Add "Open in Browser" context menu item to artist and album page (#1096)

This commit is contained in:
Changjian Gao 2021-12-20 18:57:45 +08:00 committed by GitHub
parent 16c3613267
commit 5c6eaa8fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 2 deletions

View file

@ -137,6 +137,9 @@
<div class="item" @click="copyUrl(album.id)">{{
$t('contextMenu.copyUrl')
}}</div>
<div class="item" @click="openInBrowser(album.id)">{{
$t('contextMenu.openInBrowser')
}}</div>
</ContextMenu>
</div>
</template>
@ -305,7 +308,7 @@ export default {
},
copyUrl(id) {
let showToast = this.showToast;
this.$copyText('https://music.163.com/#/album?id=' + id)
this.$copyText(`https://music.163.com/#/album?id=${id}`)
.then(function () {
showToast(locale.t('toast.copied'));
})
@ -313,6 +316,10 @@ export default {
showToast(`${locale.t('toast.copyFailed')}${error}`);
});
},
openInBrowser(id) {
const url = `https://music.163.com/#/album?id=${id}`;
window.open(url);
},
},
};
</script>