gitlab-org--gitlab-foss/app/assets/javascripts/related_merge_requests/index.js
Fatih Acet 7650677d3d
Rewrite related MRs widget with Vue
This MR rewrites existing Related Merge Requests widget
with Vue with reusing shared Related Issues components
2019-04-05 21:20:28 +02:00

24 lines
760 B
JavaScript

import Vue from 'vue';
import RelatedMergeRequests from './components/related_merge_requests.vue';
import createStore from './store';
export default function initRelatedMergeRequests() {
const relatedMergeRequestsElement = document.querySelector('#js-related-merge-requests');
if (relatedMergeRequestsElement) {
const { endpoint, projectPath, projectNamespace } = relatedMergeRequestsElement.dataset;
// eslint-disable-next-line no-new
new Vue({
el: relatedMergeRequestsElement,
components: {
RelatedMergeRequests,
},
store: createStore(),
render: createElement =>
createElement('related-merge-requests', {
props: { endpoint, projectNamespace, projectPath },
}),
});
}
}