debian-mirror-gitlab/app/assets/javascripts/nav/mount.js

24 lines
436 B
JavaScript
Raw Normal View History

2021-06-08 01:23:25 +05:30
import Vue from 'vue';
import Vuex from 'vuex';
import App from './components/top_nav_app.vue';
import { createStore } from './stores';
Vue.use(Vuex);
export const mountTopNav = (el) => {
const viewModel = JSON.parse(el.dataset.viewModel);
const store = createStore();
return new Vue({
el,
store,
render(h) {
return h(App, {
props: {
navData: viewModel,
},
});
},
});
};