debian-mirror-gitlab/app/assets/javascripts/contributors/index.js
2021-04-29 21:17:54 +05:30

26 lines
599 B
JavaScript

import Vue from 'vue';
import ContributorsGraphs from './components/contributors.vue';
import { createStore } from './stores';
export default () => {
const el = document.querySelector('.js-contributors-graph');
if (!el) return null;
const { projectGraphPath, projectBranch, defaultBranch } = el.dataset;
const store = createStore(defaultBranch);
return new Vue({
el,
store,
render(createElement) {
return createElement(ContributorsGraphs, {
props: {
endpoint: projectGraphPath,
branch: projectBranch,
},
});
},
});
};