gitlab-org--gitlab-foss/app/assets/javascripts/contributors/index.js

27 lines
599 B
JavaScript
Raw Normal View History

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,
},
});
},
});
};