ปรับ currentRouteName
This commit is contained in:
parent
749c79dfd4
commit
6009cba016
1 changed files with 37 additions and 30 deletions
|
|
@ -9,12 +9,12 @@ const $q = useQuasar();
|
||||||
|
|
||||||
const tab = ref('')
|
const tab = ref('')
|
||||||
|
|
||||||
const currentRouteName = ref('');
|
const currentRouteName = router.currentRoute.value.name;
|
||||||
|
const currentRoute = ref(currentRouteName);
|
||||||
const text = ref('');
|
const text = ref('');
|
||||||
const menuList = [
|
const menuList = [
|
||||||
{text:'ข้อมูลหลัก',path: 'metadata'},
|
{text:'ข้อมูลหลัก',path: 'metadata'},
|
||||||
{text:'โครงสร้างอัตรากำลัง',path: 'organizational'},
|
{text:'โครงสร้างอัตรากำลัง',path: 'organizational'},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const mainmenu = [
|
const mainmenu = [
|
||||||
|
|
@ -33,26 +33,29 @@ const mainmenu = [
|
||||||
|
|
||||||
const clickMain = (val: string) => {
|
const clickMain = (val: string) => {
|
||||||
router.push(val)
|
router.push(val)
|
||||||
currentRouteName.value = val
|
currentRoute.value = val
|
||||||
tab.value=val
|
tab.value=val
|
||||||
};
|
};
|
||||||
|
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
currentRouteName.value = ''
|
currentRoute.value = 'home'
|
||||||
};
|
};
|
||||||
|
|
||||||
const click = () => {
|
const click = () => {
|
||||||
router.push('/contact')
|
router.push('/contact')
|
||||||
currentRouteName.value = 'contact'
|
currentRoute.value = 'contact'
|
||||||
};
|
};
|
||||||
|
const scrollInfo = ref({})
|
||||||
|
const onScroll = (info: any) => { scrollInfo.value = info}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- โครงเว็บ -->
|
<!-- โครงเว็บ -->
|
||||||
<template>
|
<template>
|
||||||
<q-layout view="hHh LpR fFr">
|
<q-layout view="hHh LpR fFr">
|
||||||
|
<q-scroll-observer @scroll="onScroll" />
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<q-header flat class="text-dark col-12 bg-header bg-transparent" height-hint="7">
|
<q-header flat class="text-dark col-12 bg-transparent" height-hint="7">
|
||||||
<q-toolbar class="q-my-xs items-center" :style="$q.screen.gt.xs ? 'padding: 1% 2%;': 'padding: 1% 4%;'">
|
<q-toolbar class="q-my-xs items-center" :style="$q.screen.gt.xs ? 'padding: 1% 2%;': 'padding: 1% 4%;'">
|
||||||
<div class="row items-center no-wrap cursor-pointer" @click="goHome" v-if="$q.screen.gt.xs">
|
<div class="row items-center no-wrap cursor-pointer" @click="goHome" v-if="$q.screen.gt.xs">
|
||||||
<q-img src="@/assets/logo.png" spinner-color="white" style="height: 35px; max-width: 35px"/>
|
<q-img src="@/assets/logo.png" spinner-color="white" style="height: 35px; max-width: 35px"/>
|
||||||
|
|
@ -76,12 +79,10 @@ const click = () => {
|
||||||
<img src="@/assets/logo.png" style="height: 35px; max-width: 35px" />
|
<img src="@/assets/logo.png" style="height: 35px; max-width: 35px" />
|
||||||
</div>
|
</div>
|
||||||
<q-space></q-space>
|
<q-space></q-space>
|
||||||
<div>
|
<div class="row q-col-gutter-x-sm">
|
||||||
<q-btn flat color="primary" label="หน้าแรก" @click="goHome"/>
|
<div><q-btn flat color="white" label="หน้าแรก" @click="goHome"/></div>
|
||||||
<q-btn color="white" text-color="black" label="ติดต่อเรา" @click="click()"/>
|
<div><q-btn color="primary" label="ติดต่อเรา" @click="click()"/></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</q-header>
|
</q-header>
|
||||||
|
|
||||||
|
|
@ -99,7 +100,7 @@ const click = () => {
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-10 col-md-8 row q-col-gutter-md" style=" margin-top: 80px;" v-if="currentRouteName == ''">
|
<div class="col-xs-10 col-md-8 row q-col-gutter-md" style=" margin-top: 80px;" v-if="currentRoute == 'home'">
|
||||||
<div class="col-12 row justify-center text-h6 text-dark">ระบบทรัพยากรบุคคล</div>
|
<div class="col-12 row justify-center text-h6 text-dark">ระบบทรัพยากรบุคคล</div>
|
||||||
<div class="col-12"><q-separator color="grey-4" /></div>
|
<div class="col-12"><q-separator color="grey-4" /></div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
@ -118,10 +119,10 @@ const click = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-9 row q-col-gutter-md" style=" margin-top: 80px;" v-else>
|
<div class="col-9 row" style=" margin-top: 80px;" v-else>
|
||||||
<div class="col-12 content-heigt">
|
<q-layout>
|
||||||
|
<q-page-container class="col-12">
|
||||||
|
<q-page>
|
||||||
<div class="col-12 row ">
|
<div class="col-12 row ">
|
||||||
<q-card class="col-12">
|
<q-card class="col-12">
|
||||||
<router-view :key="$route.fullPath" />
|
<router-view :key="$route.fullPath" />
|
||||||
|
|
@ -135,10 +136,16 @@ const click = () => {
|
||||||
<q-tab name="articles" label="Articles" />
|
<q-tab name="articles" label="Articles" />
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</q-page>
|
||||||
|
</q-page-container>
|
||||||
|
</q-layout>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-page>
|
</q-page>
|
||||||
|
<!-- place QPageScroller at end of page -->
|
||||||
|
<q-page-scroller position="bottom-right" :scroll-offset="150" :offset="[18, 18]">
|
||||||
|
<q-btn fab icon="keyboard_arrow_up" color="blue" />
|
||||||
|
</q-page-scroller>
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
</q-layout>
|
</q-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -208,7 +215,7 @@ const click = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-heigt{
|
.content-heigt{
|
||||||
height: 55vh !important;
|
height: 60vh !important;
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue