summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/runner/runner_details/index.js
blob: cbf70640ef76557451d3a6f389b0677e61ea7cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Vue from 'vue';
import RunnerDetailsApp from './runner_details_app.vue';

export const initRunnerDetail = (selector = '#js-runner-detail') => {
  const el = document.querySelector(selector);

  if (!el) {
    return null;
  }

  const { runnerId } = el.dataset;

  return new Vue({
    el,
    render(h) {
      return h(RunnerDetailsApp, {
        props: {
          runnerId,
        },
      });
    },
  });
};