Welcome to mirror list, hosted at ThFree Co, Russian Federation.

custom_emoji_bundle.js « custom_emoji « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c9c3f0831fd1fd02ff7e43505964feeba95bf015 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Vue from 'vue';
import VueRouter from 'vue-router';
import VueApollo from 'vue-apollo';
import defaultClient from './graphql_client';
import routes from './routes';
import App from './components/app.vue';

export const initCustomEmojis = () => {
  Vue.use(VueApollo);
  Vue.use(VueRouter);

  const el = document.getElementById('js-custom-emojis-root');

  if (!el) return;

  const apolloProvider = new VueApollo({
    defaultClient,
  });
  const router = new VueRouter({
    base: el.dataset.basePath,
    mode: 'history',
    routes,
  });
  const { groupPath } = el.dataset;

  // eslint-disable-next-line no-new
  new Vue({
    el,
    name: 'CustomEmojiApp',
    router,
    apolloProvider,
    provide: {
      groupPath,
    },
    render(createElement) {
      return createElement(App);
    },
  });
};