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

index.js « show « candidates « ml « projects « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1acef5ac136f9404b4aea2cec64236ef02c2420 (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
import Vue from 'vue';
import MlCandidate from '~/ml/experiment_tracking/components/ml_candidate.vue';

const initShowCandidate = () => {
  const element = document.querySelector('#js-show-ml-candidate');
  if (!element) {
    return;
  }

  const container = document.createElement('div');
  element.appendChild(container);

  const candidate = JSON.parse(element.dataset.candidate);

  // eslint-disable-next-line no-new
  new Vue({
    el: container,
    provide: {
      candidate,
    },
    render(h) {
      return h(MlCandidate);
    },
  });
};

initShowCandidate();