2021-03-11 19:13:27 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import CompareApp from './components/app.vue';
|
|
|
|
|
|
|
|
export default function init() {
|
|
|
|
const el = document.getElementById('js-compare-selector');
|
2021-04-17 20:07:23 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
const {
|
|
|
|
refsProjectPath,
|
|
|
|
paramsFrom,
|
|
|
|
paramsTo,
|
|
|
|
projectCompareIndexPath,
|
|
|
|
projectMergeRequestPath,
|
|
|
|
createMrPath,
|
2021-10-27 15:23:28 +05:30
|
|
|
projectTo,
|
|
|
|
projectsFrom,
|
2021-03-11 19:13:27 +05:30
|
|
|
} = el.dataset;
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
2021-10-27 15:23:28 +05:30
|
|
|
CompareApp,
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
render(createElement) {
|
2021-10-27 15:23:28 +05:30
|
|
|
return createElement(CompareApp, {
|
2021-03-11 19:13:27 +05:30
|
|
|
props: {
|
|
|
|
refsProjectPath,
|
|
|
|
paramsFrom,
|
|
|
|
paramsTo,
|
|
|
|
projectCompareIndexPath,
|
|
|
|
projectMergeRequestPath,
|
|
|
|
createMrPath,
|
2021-10-27 15:23:28 +05:30
|
|
|
defaultProject: JSON.parse(projectTo),
|
|
|
|
projects: JSON.parse(projectsFrom),
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|