populate events trough apicall and save active event in url
This commit is contained in:
parent
fbf6d9dc91
commit
cc9ba38dac
11 changed files with 137 additions and 61 deletions
|
@ -28,11 +28,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-xl-8">
|
||||
<transition-group name="card-list" tag="div" class="card-columns">
|
||||
<div class="card-columns">
|
||||
<div class="card-list-item card bg-dark text-light" v-for="item in internalItems" :key="item[keyName]">
|
||||
<slot v-bind:item="item"/>
|
||||
</div>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -48,14 +48,3 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.card-list-enter, .card-list-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.card-list-leave-active {
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
|
@ -3,11 +3,11 @@
|
|||
<div class="dropdown">
|
||||
<button class="btn text-light dropdown-toggle btn-heading" type="button" id="dropdownMenuButton"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{ activeEvent.slug }}
|
||||
{{getEventSlug}}
|
||||
</button>
|
||||
<div class="dropdown-menu bg-dark" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item text-light" href="#" v-for="(event, index) in events" v-bind:key="index"
|
||||
:class="{ active: event === activeEvent }" @click="changeEvent(event)">{{ event.slug }}</a>
|
||||
:class="{ active: event.slug === getEventSlug }" @click="changeEvent(event)">{{ event.slug }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapActions, mapMutations } from 'vuex';
|
||||
import { mapState, mapActions, mapMutations, mapGetters} from 'vuex';
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -79,6 +79,7 @@ export default {
|
|||
}),
|
||||
computed: {
|
||||
...mapState(['events', 'activeEvent', 'layout']),
|
||||
...mapGetters(['getEventSlug']),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['changeEvent']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue