You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

86 lines
2.2 KiB

<template>
<v-app>
<NavBar />
<v-main>
<!-- <Nuxt /> -->
<Nuxt keep-alive :keep-alive-props="{ include: includeArr }" />
</v-main>
<Footer />
<customNotifications></customNotifications>
<!-- <customMessenger></customMessenger> -->
</v-app>
</template>
<!-- will be converted into something like this -->
<!-- <div>
<KeepAlive :exclude="includeArr">
<RouterView />
</KeepAlive>
</div> -->
<script>
import NavBar from "../components/NavBar.vue";
import Footer from "../components/Footer.vue";
import customNotifications from "@/components/newComponent/notifications/notifications.vue";
// import customMessenger from "@/components/fb-messenger/customMessenger.vue";
export default {
name: "DefaultLayout",
components: {
Footer,
NavBar,
customNotifications,
// customMessenger,
},
data() {
return {
includeArr: ['ServiceList','ExhibitionView']
};
},
computed: {
drawerAcitve() {
return this.$store.getters.getDrawerStatus;
},
searchDialogActive() {
return this.$store.getters.getSearchDialogStatus;
}
},
watch: {
// $route: {
// immediate: true, //加上此配置之後,watch既可以在首次進入或刷新之後執行handler (),即初始化可執行監聽
// handler (to, from) { //監聽回調
// this.$store.dispatch("toggleOrgID");
// }
// },
drawerAcitve: {
handler: function () {
this.bsd(this.drawerAcitve);
}
},
searchDialogActive: {
handler: function () {
this.bsd(this.searchDialogActive);
}
}
},
methods: {
bsd(status) {
var body = document.querySelector("body");
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
window.onscroll = function () { };
if (status === true) {
if (window.onscroll !== null) {
window.onscroll = function () {
window.scrollTo(scrollLeft, scrollTop);
};
}
} else {
window.onscroll = function () { };
}
}
}
};
</script>
<style lang="scss" scoped>
</style>