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.

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