Added collections loading
This commit is contained in:
13
src/views/Collection.vue
Normal file
13
src/views/Collection.vue
Normal 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
46
src/views/Collections.vue
Normal 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>
|
@ -1,17 +0,0 @@
|
||||
<template>
|
||||
<b-container>
|
||||
<div class="home">
|
||||
<h1>home</h1>
|
||||
</div>
|
||||
</b-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
@ -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
15
src/views/Track.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
asd
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Track"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user