gitlab-org--gitlab-foss/app/assets/javascripts/groups/members/index.js

31 lines
712 B
JavaScript
Raw Normal View History

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'),
});
};