debian-mirror-gitlab/app/assets/javascripts/groups/visibility_level.js
2021-02-22 17:27:13 +05:30

24 lines
578 B
JavaScript

import Vue from 'vue';
import VisibilityLevelDropdown from './components/visibility_level_dropdown.vue';
export default () => {
const el = document.querySelector('.js-visibility-level-dropdown');
if (!el) {
return null;
}
const { visibilityLevelOptions, defaultLevel } = el.dataset;
return new Vue({
el,
render(createElement) {
return createElement(VisibilityLevelDropdown, {
props: {
visibilityLevelOptions: JSON.parse(visibilityLevelOptions),
defaultLevel: Number(defaultLevel),
},
});
},
});
};