diff --git a/luckydiamond/src/components/adaptive-components/HeaderMobileComponent.vue b/luckydiamond/src/components/adaptive-components/HeaderMobileComponent.vue index 9ba2ed6..f47145e 100644 --- a/luckydiamond/src/components/adaptive-components/HeaderMobileComponent.vue +++ b/luckydiamond/src/components/adaptive-components/HeaderMobileComponent.vue @@ -11,7 +11,7 @@

999

- +
diff --git a/luckydiamond/src/components/adaptive-components/MenuMobileComponent.vue b/luckydiamond/src/components/adaptive-components/MenuMobileComponent.vue index b086aa6..b6f7687 100644 --- a/luckydiamond/src/components/adaptive-components/MenuMobileComponent.vue +++ b/luckydiamond/src/components/adaptive-components/MenuMobileComponent.vue @@ -2,11 +2,11 @@ diff --git a/luckydiamond/src/main.js b/luckydiamond/src/main.js index 21baa4b..657575d 100644 --- a/luckydiamond/src/main.js +++ b/luckydiamond/src/main.js @@ -2,10 +2,12 @@ import { createApp } from 'vue' import App from './App.vue' import router from "@/router/router"; +import { Mixins } from "@/mixins/mixin"; import '@/assets/css/global.css' const app = createApp(App) app.use(router) +app.mixin(Mixins) app.mount('#app') diff --git a/luckydiamond/src/mixins/mixin.js b/luckydiamond/src/mixins/mixin.js new file mode 100644 index 0000000..b58eccd --- /dev/null +++ b/luckydiamond/src/mixins/mixin.js @@ -0,0 +1,13 @@ +export const Mixins = { + methods: { + checkWindowSize() { + this.mobile = window.innerWidth <= 600 + }, + AddWindowListener() { + window.addEventListener('resize', this.checkWindowSize) + }, + RemoveWindowListener() { + window.removeEventListener('resize', this.checkWindowSize) + } + } +} \ No newline at end of file diff --git a/luckydiamond/src/pages/HomePage.vue b/luckydiamond/src/pages/HomePage.vue index b68d671..d074778 100644 --- a/luckydiamond/src/pages/HomePage.vue +++ b/luckydiamond/src/pages/HomePage.vue @@ -1,6 +1,6 @@