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 Vue from 'vue';
|
||||||
import {App as InertiaApp, plugin, Link as ILink} from '@inertiajs/inertia-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 SvgSprite from './components/SvgSprite.js';
|
||||||
import VPages from './components/VPages.vue';
|
import VPages from './components/VPages.vue';
|
||||||
|
@ -32,6 +33,8 @@ const el = document.getElementById('app');
|
||||||
Vue.mixin(hasModule);
|
Vue.mixin(hasModule);
|
||||||
Vue.component('ILink', ILink);
|
Vue.component('ILink', ILink);
|
||||||
|
|
||||||
|
Inertia.on('start', (event) => window.dispatchEvent(new Event('inertiaStart')));
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
render: (h) =>
|
render: (h) =>
|
||||||
h(InertiaApp, {
|
h(InertiaApp, {
|
||||||
|
|
|
@ -150,8 +150,15 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
var _self = this;
|
||||||
window.addEventListener('resize', this.menuListener);
|
window.addEventListener('resize', this.menuListener);
|
||||||
this.menuListener();
|
this.menuListener();
|
||||||
|
|
||||||
|
window.addEventListener('inertiaStart', (e) => {
|
||||||
|
_self.menuVisible = false;
|
||||||
|
_self.searchVisible = false;
|
||||||
|
_self.menuOverflowVisible = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue