|
|
|
|
@ -11,11 +11,14 @@
|
|
|
|
|
const copy = (title) => {
|
|
|
|
|
navigator.clipboard.writeText(title);
|
|
|
|
|
}
|
|
|
|
|
const paste = (song) => {
|
|
|
|
|
const link = (song) => {
|
|
|
|
|
if(copiedSongs.value.findIndex(copiedSong=>copiedSong.id === song.id) === -1){
|
|
|
|
|
copiedSongs.value.push(song)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const unlink = (song) => {
|
|
|
|
|
copiedSongs.value = copiedSongs.value.filter(currSong => currSong.id !== song.id)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<h2>Songs</h2>
|
|
|
|
|
@ -36,7 +39,8 @@
|
|
|
|
|
</a>
|
|
|
|
|
<br/>
|
|
|
|
|
<button @click="copy(song.title)">Copy</button>
|
|
|
|
|
<button @click="paste(song)">Link</button>
|
|
|
|
|
<button @click="link(song)" v-if="copiedSongs.findIndex(currSong => currSong.id === song.id) === -1">Link</button>
|
|
|
|
|
<button @click="unlink(song)" v-if="copiedSongs.findIndex(currSong => currSong.id === song.id) !== -1">X</button>
|
|
|
|
|
</td>
|
|
|
|
|
<td>{{song.notes}}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|