summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/code_navigation/index.js
blob: fa5835245bc4e1e3f5852a5bd138c84f6264013e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Vue from 'vue';
import Vuex from 'vuex';
import createStore from './store';
import App from './components/app.vue';

export default initialData => {
  const el = document.getElementById('js-code-navigation');

  if (!el) return null;

  Vue.use(Vuex);

  const store = createStore();

  store.dispatch('setInitialData', initialData);

  return new Vue({
    el,
    store,
    render(h) {
      return h(App);
    },
  });
};