Files
habitica/website/client/components/groupLink.vue
2018-05-07 13:35:53 +02:00

25 lines
588 B
Vue

<template lang="pug">
b-link(
v-if='group',
@click.prevent='goToGroup'
) {{group.name}}
</template>
<script>
import { TAVERN_ID } from '../../common/script/constants';
export default {
props: ['group'],
methods: {
goToGroup () {
if (this.group.type === 'party') {
this.$router.push({name: 'party'});
} else if (this.group._id === TAVERN_ID) {
this.$router.push({name: 'tavern'});
} else {
this.$router.push({name: 'guild', params: {groupId: this.group._id}});
}
},
},
};
</script>