Added collections loading

This commit is contained in:
2020-11-26 04:44:55 +01:00
parent f85f16e2a5
commit 31f8cffec1
10 changed files with 167 additions and 43 deletions

13
src/views/Collection.vue Normal file
View File

@ -0,0 +1,13 @@
<template>
<div></div>
</template>
<script>
export default {
name: "Collection"
}
</script>
<style scoped>
</style>

46
src/views/Collections.vue Normal file
View File

@ -0,0 +1,46 @@
<template>
<b-container>
<b-row>
<b-col>
<h1>My Collections</h1>
</b-col>
</b-row>
<big-chungus-loader text="Fetching collections..." v-if="processing"/>
<b-row v-else>
<collections-list-element :title="c.name" :count="c.element_count" @click="openCollection(c.id)" :key="c.id" v-for="c in collections"/>
</b-row>
</b-container>
</template>
<script>
import BigChungusLoader from "@/components/BigChungusLoader";
import CollectionsListElement from "@/components/CollectionsListElement";
export default {
name: 'Collections',
components: {BigChungusLoader, CollectionsListElement},
data() {
return {
processing: true,
collections: {}
}
},
methods: {
openCollection(id) {
console.log(id);
}
},
mounted() {
this.$api.getAllLists().then((data) => {
if (data) {
this.collections = data.ids;
this.processing = false;
} else {
this.$showToast("Invalid response from server");
}
}).catch(({text}) => {
this.$showToast(text);
});
}
}
</script>

View File

@ -1,17 +0,0 @@
<template>
<b-container>
<div class="home">
<h1>home</h1>
</div>
</b-container>
</template>
<script>
export default {
name: 'Home',
components: {
}
}
</script>

View File

@ -76,8 +76,7 @@ export default {
this.$store.dispatch('storeUserData', name).then(() => {
this.$router.push('/').catch(() => {
});
this.$router.push({name: "Collections"}).catch(() => {});
this.processing = false;
});

15
src/views/Track.vue Normal file
View File

@ -0,0 +1,15 @@
<template>
<div>
asd
</div>
</template>
<script>
export default {
name: "Track"
}
</script>
<style scoped>
</style>