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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <v-app>
  3. <NavBar />
  4. <v-main>
  5. <!-- <Nuxt /> -->
  6. <Nuxt keep-alive :keep-alive-props="{ include: includeArr }" />
  7. </v-main>
  8. <Footer />
  9. <customNotifications></customNotifications>
  10. <!-- <customMessenger></customMessenger> -->
  11. </v-app>
  12. </template>
  13. <!-- will be converted into something like this -->
  14. <!-- <div>
  15. <KeepAlive :exclude="includeArr">
  16. <RouterView />
  17. </KeepAlive>
  18. </div> -->
  19. <script>
  20. import NavBar from "../components/NavBar.vue";
  21. import Footer from "../components/Footer.vue";
  22. import customNotifications from "@/components/newComponent/notifications/notifications.vue";
  23. // import customMessenger from "@/components/fb-messenger/customMessenger.vue";
  24. export default {
  25. name: "DefaultLayout",
  26. components: {
  27. Footer,
  28. NavBar,
  29. customNotifications,
  30. // customMessenger,
  31. },
  32. data() {
  33. return {
  34. includeArr: ['ServiceList','ExhibitionView']
  35. };
  36. },
  37. computed: {
  38. drawerAcitve() {
  39. return this.$store.getters.getDrawerStatus;
  40. },
  41. searchDialogActive() {
  42. return this.$store.getters.getSearchDialogStatus;
  43. }
  44. },
  45. watch: {
  46. // $route: {
  47. // immediate: true, //加上此配置之後,watch既可以在首次進入或刷新之後執行handler (),即初始化可執行監聽
  48. // handler (to, from) { //監聽回調
  49. // this.$store.dispatch("toggleOrgID");
  50. // }
  51. // },
  52. drawerAcitve: {
  53. handler: function () {
  54. this.bsd(this.drawerAcitve);
  55. }
  56. },
  57. searchDialogActive: {
  58. handler: function () {
  59. this.bsd(this.searchDialogActive);
  60. }
  61. }
  62. },
  63. methods: {
  64. bsd(status) {
  65. var body = document.querySelector("body");
  66. var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
  67. var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
  68. window.onscroll = function () { };
  69. if (status === true) {
  70. if (window.onscroll !== null) {
  71. window.onscroll = function () {
  72. window.scrollTo(scrollLeft, scrollTop);
  73. };
  74. }
  75. } else {
  76. window.onscroll = function () { };
  77. }
  78. }
  79. }
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. </style>