blob: d9ad29fad99f91d7fec248aff95e898fa080afed (
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
|
import Vue from 'vue';
import trackLearnGitlab from '~/learn_gitlab/track_learn_gitlab';
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;
trackLearnGitlab(learnGitlabA);
return new Vue({
el,
render(createElement) {
return createElement(learnGitlabA ? LearnGitlabA : LearnGitlabB, { props: { actions } });
},
});
}
initLearnGitlab();
|