summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_pipelines_index/index.js
blob: b4e2d3a1143dc35d567dc8a0e3e721a7c5663ccc (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 PipelinesStore from './stores/pipelines_store';
import PipelinesComponent from './pipelines';
import '../vue_shared/vue_resource_interceptor';

const Vue = window.Vue = require('vue');
window.Vue.use(require('vue-resource'));

$(() => new Vue({
  el: document.querySelector('.vue-pipelines-index'),

  data() {
    const project = document.querySelector('.pipelines');
    const store = new PipelinesStore();

    return {
      store,
      endpoint: project.dataset.url,
    };
  },
  components: {
    'vue-pipelines': PipelinesComponent,
  },
  template: `
    <vue-pipelines
      :endpoint="endpoint"
      :store="store" />
  `,
}));