debian-mirror-gitlab/app/assets/javascripts/projects/project_delete_button.js

24 lines
512 B
JavaScript
Raw Normal View History

2020-07-28 23:09:34 +05:30
import Vue from 'vue';
2020-10-24 23:57:45 +05:30
import ProjectDeleteButton from './components/project_delete_button.vue';
2020-07-28 23:09:34 +05:30
2020-10-24 23:57:45 +05:30
export default (selector = '#js-project-delete-button') => {
2020-07-28 23:09:34 +05:30
const el = document.querySelector(selector);
if (!el) return;
2020-10-24 23:57:45 +05:30
const { confirmPhrase, formPath } = el.dataset;
2020-07-28 23:09:34 +05:30
// eslint-disable-next-line no-new
new Vue({
el,
render(createElement) {
2020-10-24 23:57:45 +05:30
return createElement(ProjectDeleteButton, {
2020-07-28 23:09:34 +05:30
props: {
confirmPhrase,
formPath,
},
});
},
});
};