Commit 647ec419 authored by K9260's avatar K9260 🎅🏼

Suosikit uuteen komponenttiin

parent 59980e3e
This diff is collapsed.
This diff is collapsed.
......@@ -65,7 +65,7 @@
</v-container>
</v-content>
<v-footer color="light-green accent-4" app>
<span class="white--text">&copy; Lumiukot 2019</span>
<span id="bottom" class="white--text">&copy; Lumiukot 2019</span>
</v-footer>
</v-app>
</template>
......@@ -96,3 +96,8 @@
}
</script>
<style>
#bottom {
margin: auto
}
</style>
<template>
<div>
<div class="text-xs-center mb-3"></div>
<v-expansion-panel v-model="panel" expand: false>
<v-expansion-panel-content v-if="favorites != null">
<template v-slot:header>
<div>Suosikit</div>
</template>
<v-card color="grey lighten-3">
<v-card-text v-for="(favorite, index) in favorites2" :key="index" @click="pushFavorite(favorite)" class="fav"> {{ favorite }} </v-card-text>
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
</div>
<v-select
v-model="favorite"
:items="favorites"
label="Suosikit"
prepend-icon="star"
color="light-green accent-4"
solo
></v-select>
</template>
<script>
export default {
name: 'FavoriteTab',
data: () => ({
panel: [
true
],
favorite: null,
favorites_temp: []
}),
props: {
favorites: Array,
},
methods:{
removeFavorite() {
for(var i = 0; i < this.favorites.length; i++){
if(this.favorite != this.favorites[i]){
this.favorites_temp.push(this.favorites[i]);
}
}
console.log(this.favorites_temp);
this.favorites_temp;
this.$store.commit("mutateFavorites", this.favorites_temp);
}
},
computed: {
favorites2() {
return this.$store.getters.favorites
return this.$store.getters.favorites
}
},
methods: {
pushFavorite(location) {
this.$emit('pushFavorite', location);
this.panel = 1;
}
watch: {
favorite: function(){
this.$emit('pushFavorite', this.favorite);
}
}
}
</script>
<style>
.fav:hover {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment