2021-10-17 21:01:14 +02:00
|
|
|
<template>
|
|
|
|
<div class="profile-tabs custom-checkboxes-group">
|
|
|
|
<div class="profile-tabs-checkboxes custom-checkboxes">
|
|
|
|
<div v-for="tab in tabs" class="profile-tab custom-checkbox" :key="tab">
|
|
|
|
<label>
|
|
|
|
<input
|
|
|
|
type="radio"
|
|
|
|
:id="tab"
|
|
|
|
:name="tab"
|
|
|
|
:checked="selectedTab === tab"
|
|
|
|
:disabled="disabled"
|
|
|
|
@input="$router.push(getPath(tab))"
|
|
|
|
/>
|
2021-10-20 17:38:25 +02:00
|
|
|
<span>{{ $t(`user.PROFILE.TABS.${tab}`) }}</span>
|
2021-10-17 21:01:14 +02:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { PropType, defineComponent } from 'vue'
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
name: 'UserProfileTabs',
|
|
|
|
props: {
|
|
|
|
tabs: {
|
|
|
|
type: Object as PropType<string[]>,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
selectedTab: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
edition: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
function getPath(tab: string) {
|
|
|
|
switch (tab) {
|
|
|
|
case 'PICTURE':
|
|
|
|
return '/profile/edit/picture'
|
|
|
|
case 'PREFERENCES':
|
|
|
|
return `/profile${props.edition ? '/edit' : ''}/preferences`
|
|
|
|
default:
|
|
|
|
case 'PROFILE':
|
|
|
|
return `/profile${props.edition ? '/edit' : ''}`
|
|
|
|
}
|
|
|
|
}
|
2021-10-20 17:38:25 +02:00
|
|
|
return { getPath }
|
2021-10-17 21:01:14 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~@/scss/base.scss';
|
|
|
|
|
|
|
|
.profile-tabs {
|
|
|
|
margin: $default-margin 0 $default-margin;
|
|
|
|
}
|
|
|
|
</style>
|