2020-07-15 14:09:09 -04:00
|
|
|
import Vue from 'vue';
|
2020-08-04 08:09:48 -04:00
|
|
|
import ProjectDeleteButton from './components/project_delete_button.vue';
|
2020-07-15 14:09:09 -04:00
|
|
|
|
2020-08-04 08:09:48 -04:00
|
|
|
export default (selector = '#js-project-delete-button') => {
|
2020-07-15 14:09:09 -04:00
|
|
|
const el = document.querySelector(selector);
|
|
|
|
|
|
|
|
if (!el) return;
|
|
|
|
|
2020-08-04 08:09:48 -04:00
|
|
|
const { confirmPhrase, formPath } = el.dataset;
|
2020-07-15 14:09:09 -04:00
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
render(createElement) {
|
2020-08-04 08:09:48 -04:00
|
|
|
return createElement(ProjectDeleteButton, {
|
2020-07-15 14:09:09 -04:00
|
|
|
props: {
|
|
|
|
confirmPhrase,
|
|
|
|
formPath,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|