Add functionality to make playlist export modal appear/disappear
This commit is contained in:
parent
8913b377e6
commit
8e862c61da
1 changed files with 12 additions and 7 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
:token="get_token()"
|
:token="get_token()"
|
||||||
:data_exists="data.length !== 0"
|
:data_exists="data.length !== 0"
|
||||||
:is_track_data="config.type === 'Tracks'"
|
:is_track_data="config.type === 'Tracks'"
|
||||||
@playlist_export="handle_export"
|
@playlist_export="playlist_export_modal = true"
|
||||||
@data_request="get_data"
|
@data_request="get_data"
|
||||||
/>
|
/>
|
||||||
<div v-if="error" class="error">{{ error }}</div>
|
<div v-if="error" class="error">{{ error }}</div>
|
||||||
|
|
@ -19,14 +19,20 @@
|
||||||
:item="item"
|
:item="item"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<PlaylistExport
|
||||||
|
v-if="playlist_export_modal"
|
||||||
|
:config="config"
|
||||||
|
@close="playlist_export_modal = false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as axios from "axios";
|
import * as axios from "axios";
|
||||||
import ControlCard from "./ControlBar.vue";
|
import ControlCard from "./ControlBar";
|
||||||
import ArtistCard from "./cards/Artist.vue";
|
import ArtistCard from "./cards/Artist";
|
||||||
import TrackCard from "./cards/Track.vue";
|
import TrackCard from "./cards/Track";
|
||||||
|
import PlaylistExport from "./modals/PlaylistExport";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: `MainView`,
|
name: `MainView`,
|
||||||
|
|
@ -44,11 +50,13 @@ export default {
|
||||||
Control: ControlCard,
|
Control: ControlCard,
|
||||||
Track: TrackCard,
|
Track: TrackCard,
|
||||||
Artist: ArtistCard,
|
Artist: ArtistCard,
|
||||||
|
PlaylistExport: PlaylistExport,
|
||||||
},
|
},
|
||||||
data() { return {
|
data() { return {
|
||||||
config: {},
|
config: {},
|
||||||
data: [],
|
data: [],
|
||||||
error: ``,
|
error: ``,
|
||||||
|
playlist_export_modal: false,
|
||||||
};},
|
};},
|
||||||
computed: {
|
computed: {
|
||||||
items() {
|
items() {
|
||||||
|
|
@ -60,9 +68,6 @@ export default {
|
||||||
let params = new URLSearchParams(window.location.hash.slice(1));
|
let params = new URLSearchParams(window.location.hash.slice(1));
|
||||||
return params.get(`access_token`);
|
return params.get(`access_token`);
|
||||||
},
|
},
|
||||||
handle_export() {
|
|
||||||
console.log("Handling the export");
|
|
||||||
},
|
|
||||||
get_data(config) {
|
get_data(config) {
|
||||||
let url = `${this.api_url}/me/top/${config.type.toLowerCase()}`;
|
let url = `${this.api_url}/me/top/${config.type.toLowerCase()}`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue