debian-mirror-gitlab/app/assets/javascripts/issues/related_merge_requests/index.js

23 lines
561 B
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
import Vue from 'vue';
import RelatedMergeRequests from './components/related_merge_requests.vue';
import createStore from './store';
2022-03-02 08:16:31 +05:30
export function initRelatedMergeRequests() {
const el = document.querySelector('#js-related-merge-requests');
2019-07-07 11:18:12 +05:30
2022-03-02 08:16:31 +05:30
if (!el) {
return undefined;
2019-07-07 11:18:12 +05:30
}
2022-03-02 08:16:31 +05:30
const { endpoint, projectPath, projectNamespace } = el.dataset;
return new Vue({
el,
store: createStore(),
render: (createElement) =>
createElement(RelatedMergeRequests, {
props: { endpoint, projectNamespace, projectPath },
}),
});
2019-07-07 11:18:12 +05:30
}