debian-mirror-gitlab/app/assets/javascripts/super_sidebar/super_sidebar_bundle.js
2023-03-17 16:20:25 +05:30

26 lines
543 B
JavaScript

import Vue from 'vue';
import SuperSidebar from './components/super_sidebar.vue';
export const initSuperSidebar = () => {
const el = document.querySelector('.js-super-sidebar');
if (!el) return false;
const { rootPath, sidebar, toggleNewNavEndpoint } = el.dataset;
return new Vue({
el,
name: 'SuperSidebarRoot',
provide: {
rootPath,
toggleNewNavEndpoint,
},
render(h) {
return h(SuperSidebar, {
props: {
sidebarData: JSON.parse(sidebar),
},
});
},
});
};