forked from verdnatura/salix-front
Make use of slot
This commit is contained in:
parent
a96f87d2c9
commit
78baa306b0
|
@ -1,36 +1,26 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
// import { ref } from 'vue';
|
||||||
import Navbar from 'src/components/Navbar.vue';
|
import Navbar from 'src/components/Navbar.vue';
|
||||||
import LeftMenu from 'src/components/LeftMenu.vue';
|
//import LeftMenu from 'src/components/LeftMenu.vue';
|
||||||
const drawer = ref(false);
|
// const drawer = ref(false);
|
||||||
const miniState = ref(true);
|
// const miniState = ref(true);
|
||||||
|
|
||||||
function onToggleDrawer() {
|
// function onToggleDrawer() {
|
||||||
drawer.value = !drawer.value;
|
// drawer.value = !drawer.value;
|
||||||
}
|
// }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-layout view="hHh lpR fFf">
|
<q-layout view="hHh lpR fFf">
|
||||||
<Navbar @toggle-drawer="onToggleDrawer()" />
|
<Navbar @toggle-drawer="onToggleDrawer()" />
|
||||||
<q-drawer
|
<slot name="drawer"></slot>
|
||||||
v-model="drawer"
|
|
||||||
show-if-above
|
|
||||||
:mini="miniState"
|
|
||||||
@mouseover="miniState = false"
|
|
||||||
@mouseout="miniState = true"
|
|
||||||
mini-to-overlay
|
|
||||||
:width="200"
|
|
||||||
:breakpoint="500"
|
|
||||||
>
|
|
||||||
<q-scroll-area class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</q-scroll-area>
|
|
||||||
</q-drawer>
|
|
||||||
<q-page-container>
|
<q-page-container>
|
||||||
<router-view></router-view>
|
|
||||||
|
<router-view>
|
||||||
|
</router-view>
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
</q-layout>
|
</q-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="row fit fixed">
|
<slot name="drawer">
|
||||||
<div class="col-2">
|
<q-drawer v-model="drawer" show-if-above :width="200" :breakpoint="500">
|
||||||
<q-card square>
|
<q-scroll-area class="fit text-grey-8">
|
||||||
<router-link :to="{ path: '/customer/list' }">
|
<router-link :to="{ path: '/customer/list' }">
|
||||||
<q-icon name="arrow_back" size="md" color="primary" />
|
<q-icon name="arrow_back" size="md" color="primary" />
|
||||||
</router-link>Descriptor
|
</router-link>Descriptor
|
||||||
</q-card>
|
</q-scroll-area>
|
||||||
</div>
|
</q-drawer>
|
||||||
|
|
||||||
<div class="col">
|
</slot>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import LeftMenu from 'src/components/LeftMenu.vue';
|
||||||
|
const drawer = ref(false);
|
||||||
|
const miniState = ref(true);
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<slot name="drawer">
|
||||||
|
<q-drawer v-model="drawer" show-if-above :mini="miniState" @mouseover="miniState = false"
|
||||||
|
@mouseout="miniState = true" mini-to-overlay :width="200" :breakpoint="500">
|
||||||
|
<q-scroll-area class="fit text-grey-8">
|
||||||
|
<LeftMenu />
|
||||||
|
</q-scroll-area>
|
||||||
|
</q-drawer>
|
||||||
|
|
||||||
|
</slot>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import LeftMenu from 'src/components/LeftMenu.vue';
|
||||||
|
const drawer = ref(false);
|
||||||
|
const miniState = ref(true);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<slot name="drawer">
|
||||||
|
<q-drawer v-model="drawer" show-if-above :mini="miniState" @mouseover="miniState = false"
|
||||||
|
@mouseout="miniState = true" mini-to-overlay :width="200" :breakpoint="500">
|
||||||
|
<q-scroll-area class="fit text-grey-8">
|
||||||
|
<LeftMenu />
|
||||||
|
</q-scroll-area>
|
||||||
|
</q-drawer>
|
||||||
|
</slot>
|
||||||
|
<router-view></router-view>
|
||||||
|
</template>
|
|
@ -1,4 +1,4 @@
|
||||||
import customer from './modules/customer';
|
//import customer from './modules/customer';
|
||||||
import ticket from './modules/ticket';
|
import ticket from './modules/ticket';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
|
@ -18,7 +18,43 @@ const routes = [
|
||||||
path: '/dashboard',
|
path: '/dashboard',
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
meta: { title: 'dashboard', icon: 'dashboard' },
|
meta: { title: 'dashboard', icon: 'dashboard' },
|
||||||
component: () => import('../pages/Dashboard/Dashboard.vue'),
|
component: () => import('../pages/Dashboard/DashboardLayout.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/customer',
|
||||||
|
name: 'Customer',
|
||||||
|
meta: {
|
||||||
|
title: 'customers',
|
||||||
|
icon: 'vn:client',
|
||||||
|
roles: ['salesPerson'],
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/CustomerLayout.vue'),
|
||||||
|
redirect: { name: 'CustomerList' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
name: 'CustomerList',
|
||||||
|
meta: {
|
||||||
|
title: 'list'
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/CustomerList.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
|
||||||
|
redirect: { name: 'CustomerBasicData' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'CustomerBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData'
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Customer/Card/CustomerBasicData.vue'),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
/* {
|
/* {
|
||||||
path: '/:pathMatch(.*)*',
|
path: '/:pathMatch(.*)*',
|
||||||
|
@ -26,7 +62,7 @@ const routes = [
|
||||||
component: () => import('../pages/NotFound.vue'),
|
component: () => import('../pages/NotFound.vue'),
|
||||||
}, */
|
}, */
|
||||||
// Module routes
|
// Module routes
|
||||||
customer,
|
//customer,
|
||||||
ticket,
|
ticket,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue