Hide menu when navigating page
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1ab866a2fe
commit
be3336a18d
|
@ -1,5 +1,6 @@
|
|||
import Vue from 'vue';
|
||||
import {App as InertiaApp, plugin, Link as ILink} from '@inertiajs/inertia-vue';
|
||||
import {Inertia} from '@inertiajs/inertia';
|
||||
|
||||
import SvgSprite from './components/SvgSprite.js';
|
||||
import VPages from './components/VPages.vue';
|
||||
|
@ -32,6 +33,8 @@ const el = document.getElementById('app');
|
|||
Vue.mixin(hasModule);
|
||||
Vue.component('ILink', ILink);
|
||||
|
||||
Inertia.on('start', (event) => window.dispatchEvent(new Event('inertiaStart')));
|
||||
|
||||
new Vue({
|
||||
render: (h) =>
|
||||
h(InertiaApp, {
|
||||
|
|
|
@ -150,8 +150,15 @@ export default {
|
|||
},
|
||||
},
|
||||
created() {
|
||||
var _self = this;
|
||||
window.addEventListener('resize', this.menuListener);
|
||||
this.menuListener();
|
||||
|
||||
window.addEventListener('inertiaStart', (e) => {
|
||||
_self.menuVisible = false;
|
||||
_self.searchVisible = false;
|
||||
_self.menuOverflowVisible = false;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue