debian-mirror-gitlab/app/assets/javascripts/groups/members/index.js

31 lines
712 B
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import Vue from 'vue';
import Vuex from 'vuex';
import App from './components/app.vue';
import membersModule from '~/vuex_shared/modules/members';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
export default el => {
if (!el) {
return () => {};
}
Vue.use(Vuex);
const { members, groupId } = el.dataset;
const store = new Vuex.Store({
...membersModule({
members: convertObjectPropsToCamelCase(JSON.parse(members), { deep: true }),
sourceId: parseInt(groupId, 10),
currentUserId: gon.current_user_id || null,
}),
});
return new Vue({
el,
components: { App },
store,
render: createElement => createElement('app'),
});
};