blob: 9ea1331d5636392e928c2bf60aca737b994b6ff1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import SortDropdown from './components/sort_dropdown.vue';
const mountDropdownApp = (el) => {
const { projectBranchesFilteredPath, sortOptions, showDropdown, sortedBy } = el.dataset;
return new Vue({
el,
name: 'SortBranchesDropdownApp',
components: {
SortDropdown,
},
provide: {
projectBranchesFilteredPath,
sortOptions: JSON.parse(sortOptions),
showDropdown: parseBoolean(showDropdown),
sortedBy,
},
render: (createElement) => createElement(SortDropdown),
});
};
export default () => {
const el = document.getElementById('js-branches-sort-dropdown');
return el ? mountDropdownApp(el) : null;
};
|