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.

77 lines
1.9 KiB

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