| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <q-layout class="relative" view="hHh lpR fFf">
- <LeftMenuLayout v-model="leftDrawerOpen" />
- <q-page-container>
- <q-page>
- <q-scroll-area
- ref="scrollAreaRef"
- style="
- height: calc(100dvh - 50px - env(safe-area-inset-top)) !important;
- "
- >
- <router-view v-slot="{ Component }">
- <Transition>
- <component :is="Component" />
- </Transition>
- </router-view>
- </q-scroll-area>
- </q-page>
- </q-page-container>
- </q-layout>
- </template>
- <script setup>
- import { ref, useTemplateRef, watch } from "vue";
- import { useRoute } from "vue-router";
- import LeftMenuLayout from "src/components/geral/LeftMenuLayout.vue";
- defineOptions({
- name: "MainLayout",
- });
- const leftDrawerOpen = ref(false);
- const scrollAreaRef = useTemplateRef("scrollAreaRef");
- const route = useRoute();
- let oldValue = route.path;
- watch(route, (value) => {
- if (oldValue.path != value.path) {
- scrollAreaRef.value.setScrollPosition("vertical", 0, 250);
- scrollAreaRef.value.setScrollPosition("horizontal", 0, 250);
- }
- oldValue = value.path;
- });
- </script>
- <style scoped>
- .v-enter-active {
- opacity: 1;
- transition: all 0.15s ease-in;
- }
- .v-leave-active {
- opacity: 1;
- transition: all 0.15s ease-out;
- }
- .v-enter-from,
- .v-leave-to {
- opacity: 0;
- transition: all 0.15s ease-in;
- }
- .v-leave-to {
- transition: all 0.15s ease-out;
- }
- </style>
|