scinote-web/app/javascript/packs/vue/navigation/top_menu.js

28 lines
750 B
JavaScript
Raw Normal View History

import Vue from 'vue/dist/vue.esm';
import TopMenuContainer from '../../../vue/navigation/top_menu.vue';
import PerfectScrollbar from 'vue2-perfect-scrollbar';
import 'vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css';
2023-09-22 17:59:39 +08:00
import outsideClick from '../directives/outside_click';
Vue.use(PerfectScrollbar);
2023-09-22 17:59:39 +08:00
Vue.directive('click-outside', outsideClick);
Vue.prototype.i18n = window.I18n;
function addNavigationTopMenuContainer() {
new Vue({
el: '#sciNavigationTopMenuContainer',
components: {
'top-menu-container': TopMenuContainer
}
});
}
if (document.readyState !== 'loading') {
addNavigationTopMenuContainer();
} else {
window.addEventListener('DOMContentLoaded', () => {
addNavigationTopMenuContainer();
});
}