debian-mirror-gitlab/app/assets/javascripts/projects/prune_objects_button.js
2023-04-23 21:23:45 +05:30

23 lines
579 B
JavaScript

import Vue from 'vue';
import PruneUnreachableObjectsButton from './prune_unreachable_objects_button.vue';
export default (selector = '#js-project-prune-unreachable-objects-button') => {
const el = document.querySelector(selector);
if (!el) return;
const { pruneObjectsPath, pruneObjectsDocPath } = el.dataset;
// eslint-disable-next-line no-new
new Vue({
el,
render(createElement) {
return createElement(PruneUnreachableObjectsButton, {
props: {
pruneObjectsPath,
pruneObjectsDocPath,
},
});
},
});
};