Add clipboard copying functionality to the buttons.
This commit is contained in:
parent
a2f927918c
commit
1592fd63c1
2 changed files with 5 additions and 3 deletions
|
|
@ -10,19 +10,19 @@
|
||||||
<h2 class="center">Track Sharing</h2>
|
<h2 class="center">Track Sharing</h2>
|
||||||
<div class="share-buttons">
|
<div class="share-buttons">
|
||||||
<button
|
<button
|
||||||
@click="copy_link(track.external_urls.spotify)"
|
@click="copy_text(track.external_urls.spotify)"
|
||||||
>
|
>
|
||||||
Copy Track Link
|
Copy Track Link
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click="copy_link(track.album.external_urls.spotify)"
|
@click="copy_text(track.album.external_urls.spotify)"
|
||||||
>
|
>
|
||||||
Copy Album Link
|
Copy Album Link
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-for="artist in track.artists"
|
v-for="artist in track.artists"
|
||||||
:key="artist.uri"
|
:key="artist.uri"
|
||||||
@click="copy_link(artist.external_urls.spotify)"
|
@click="copy_text(artist.external_urls.spotify)"
|
||||||
>
|
>
|
||||||
Copy {{ artist.name }}'s Link
|
Copy {{ artist.name }}'s Link
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VTooltip from 'v-tooltip';
|
import VTooltip from 'v-tooltip';
|
||||||
|
import * as clipboard from 'clipboard-polyfill/text';
|
||||||
import TextareaAutosize from 'vue-textarea-autosize';
|
import TextareaAutosize from 'vue-textarea-autosize';
|
||||||
import VueEllipseProgress from 'vue-ellipse-progress';
|
import VueEllipseProgress from 'vue-ellipse-progress';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
|
@ -44,6 +45,7 @@ Vue.mixin({
|
||||||
window.location.href = this.home_page;
|
window.location.href = this.home_page;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
copy_text: clipboard.writeText,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue