2020-09-11 20:08:44 -04:00
|
|
|
import Vue from 'vue';
|
2020-09-17 14:10:12 -04:00
|
|
|
import Vuex from 'vuex';
|
2020-09-11 20:08:44 -04:00
|
|
|
import App from './components/app.vue';
|
2020-09-17 14:10:12 -04:00
|
|
|
import membersModule from '~/vuex_shared/modules/members';
|
2020-09-11 20:08:44 -04:00
|
|
|
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
|
|
|
|
|
|
|
|
export default el => {
|
|
|
|
if (!el) {
|
|
|
|
return () => {};
|
|
|
|
}
|
|
|
|
|
2020-09-17 14:10:12 -04:00
|
|
|
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,
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2020-09-11 20:08:44 -04:00
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
components: { App },
|
2020-09-17 14:10:12 -04:00
|
|
|
store,
|
|
|
|
render: createElement => createElement('app'),
|
2020-09-11 20:08:44 -04:00
|
|
|
});
|
|
|
|
};
|