2018-10-12 16:42:54 +02:00
|
|
|
<template>
|
2018-10-13 19:14:58 +02:00
|
|
|
<div class="list no-border platform-delimiter light-paragraph">
|
|
|
|
|
<q-icon name="action"/>
|
|
|
|
|
<template v-for="(parent, index) in links">
|
2019-01-29 03:12:18 +01:00
|
|
|
<!--
|
|
|
|
|
<div class="list-label cursor-pointer" @click="parent.show = !parent.show">
|
|
|
|
|
{{replaceUnderlineToSpace(index)}} <div class="menu_freccina"><i aria-hidden="true" class="v-icon material-icons theme--light">keyboard_arrow_down</i></div>
|
|
|
|
|
</div>
|
|
|
|
|
-->
|
|
|
|
|
<div class="q-list-header">{{replaceUnderlineToSpace(index)}}</div>
|
|
|
|
|
<template v-for="child in parent.routes">
|
|
|
|
|
<div v-if="child.routes2">
|
2019-03-11 19:16:39 +01:00
|
|
|
<q-expansion-item menu :label="$t(child.name)" icon="format_list_bulleted" class="titleSubMenu">
|
2019-01-29 03:12:18 +01:00
|
|
|
<div v-for="child2 in child.routes2">
|
|
|
|
|
<q-item link :to="child2.route" exact
|
|
|
|
|
class="item item-link drawer-closer cursor-pointer">
|
|
|
|
|
<i :class="child2.faIcon" class="item-primary"></i>
|
|
|
|
|
<div class="item-content">{{$t(child2.name)}}</div>
|
|
|
|
|
</q-item>
|
|
|
|
|
</div>
|
2019-03-11 19:16:39 +01:00
|
|
|
</q-expansion-item>
|
2018-10-13 19:14:58 +02:00
|
|
|
</div>
|
2019-01-29 03:12:18 +01:00
|
|
|
<div v-else>
|
2019-01-05 23:34:29 +01:00
|
|
|
<q-slide-transition :duration=200>
|
2019-01-08 01:22:09 +01:00
|
|
|
<div v-show="true">
|
2019-01-05 20:11:41 +01:00
|
|
|
<q-item link :to="child.route" exact
|
|
|
|
|
class="item item-link drawer-closer cursor-pointer">
|
|
|
|
|
<i :class="child.faIcon" class="item-primary"></i>
|
|
|
|
|
<div class="item-content">{{$t(child.name)}}</div>
|
|
|
|
|
</q-item>
|
2018-10-13 19:14:58 +02:00
|
|
|
</div>
|
2019-01-05 20:11:41 +01:00
|
|
|
</q-slide-transition>
|
2019-01-29 03:12:18 +01:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2018-10-13 19:14:58 +02:00
|
|
|
</template>
|
|
|
|
|
</div>
|
2018-10-12 16:42:54 +02:00
|
|
|
</template>
|
|
|
|
|
|
2019-03-11 19:16:39 +01:00
|
|
|
<script lang="ts">
|
|
|
|
|
import Vue from 'vue'
|
|
|
|
|
import { Prop, Watch } from "vue-property-decorator"
|
|
|
|
|
|
|
|
|
|
export default class menuOne extends Vue {
|
|
|
|
|
@Prop({ required: true }) links
|
|
|
|
|
|
|
|
|
|
@Watch('$route.path')
|
|
|
|
|
modifroute() {
|
|
|
|
|
Object.keys(this.links).forEach(parentName => {
|
|
|
|
|
this.setParentVisibilityBasedOnRoute(this.links[parentName])
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get currentRoutePath() {
|
|
|
|
|
return this.$route.path
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
console.log("MENUONE CREATED!")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setParentVisibilityBasedOnRoute(parent) {
|
|
|
|
|
parent.routes.forEach(item => {
|
|
|
|
|
if (this.$route.path === item.route) {
|
|
|
|
|
parent.show = true
|
|
|
|
|
return
|
2018-10-12 16:42:54 +02:00
|
|
|
}
|
2019-03-11 19:16:39 +01:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
replaceUnderlineToSpace(text) {
|
|
|
|
|
while (text.indexOf('_') !== -1) {
|
|
|
|
|
text = text.replace('_', ' ')
|
2018-10-12 16:42:54 +02:00
|
|
|
}
|
2019-03-11 19:16:39 +01:00
|
|
|
return text
|
2018-10-12 16:42:54 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
2018-10-13 19:14:58 +02:00
|
|
|
|
2019-01-08 01:22:09 +01:00
|
|
|
.q-list-header {
|
|
|
|
|
min-height: 12px;
|
|
|
|
|
padding: 5px 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-29 03:12:18 +01:00
|
|
|
.menu-hr {
|
2019-01-05 20:11:41 +01:00
|
|
|
border-color: #dedede;
|
|
|
|
|
height: 0.5px;
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-13 19:14:58 +02:00
|
|
|
.router-link-active {
|
|
|
|
|
color: #027be3;
|
|
|
|
|
background-color: #dadada !important;
|
|
|
|
|
border-right: 2px solid #027be3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.list-label:first-child {
|
|
|
|
|
line-height: 20px;
|
2019-01-05 20:11:41 +01:00
|
|
|
padding: 5px;
|
|
|
|
|
margin: 1px;
|
2018-10-13 19:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
2019-01-05 20:11:41 +01:00
|
|
|
/*
|
2018-10-13 19:14:58 +02:00
|
|
|
.menu-enter-active, .scale-enter {
|
2019-01-05 20:11:41 +01:00
|
|
|
-webkit-animation: moveFromTopFade .5s ease both;
|
|
|
|
|
animation: moveFromTopFade .5s ease both;
|
2018-10-13 19:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-leave-to, .scale-leave-active {
|
2019-01-05 20:11:41 +01:00
|
|
|
-webkit-animation: moveToBottom .5s ease both;
|
|
|
|
|
animation: moveToBottom .5s ease both;
|
2018-10-13 19:14:58 +02:00
|
|
|
}
|
2019-01-05 20:11:41 +01:00
|
|
|
*/
|
2018-10-13 19:14:58 +02:00
|
|
|
|
|
|
|
|
.router-link-active {
|
|
|
|
|
color: #027be3;
|
|
|
|
|
background-color: #dadada !important;
|
|
|
|
|
border-right: 2px solid #027be3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.router-link-active .item-primary {
|
|
|
|
|
color: #027be3;
|
|
|
|
|
}
|
2019-01-05 20:11:41 +01:00
|
|
|
|
|
|
|
|
.menu_freccina {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 10px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
padding: 0 0px 0px 0px;
|
|
|
|
|
-webkit-transform: rotate(-180deg);
|
|
|
|
|
transform: rotate(-180deg);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-12 16:42:54 +02:00
|
|
|
</style>
|