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

index.js « index « learn_gitlab « projects « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c4dec89b984d8c633daf2d5b604b59b811bae7f7 (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
import Vue from 'vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import LearnGitlabA from '../components/learn_gitlab_a.vue';
import LearnGitlabB from '../components/learn_gitlab_b.vue';

function initLearnGitlab() {
  const el = document.getElementById('js-learn-gitlab-app');

  if (!el) {
    return false;
  }

  const actions = convertObjectPropsToCamelCase(JSON.parse(el.dataset.actions));

  const { learnGitlabA } = gon.experiments;

  return new Vue({
    el,
    render(createElement) {
      return createElement(learnGitlabA ? LearnGitlabA : LearnGitlabB, { props: { actions } });
    },
  });
}

initLearnGitlab();