2021-10-29 20:10:32 -04:00
|
|
|
import Vue from 'vue';
|
2021-11-15 16:14:31 -05:00
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2021-10-29 20:10:32 -04:00
|
|
|
import CrmContactsRoot from './components/contacts_root.vue';
|
|
|
|
|
2021-11-15 16:14:31 -05:00
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2021-10-29 20:10:32 -04:00
|
|
|
export default () => {
|
|
|
|
const el = document.getElementById('js-crm-contacts-app');
|
|
|
|
|
2021-11-15 16:14:31 -05:00
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
|
2021-10-29 20:10:32 -04:00
|
|
|
if (!el) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-12-03 01:10:53 -05:00
|
|
|
const { groupFullPath, groupIssuesPath } = el.dataset;
|
|
|
|
|
2021-10-29 20:10:32 -04:00
|
|
|
return new Vue({
|
|
|
|
el,
|
2021-11-15 16:14:31 -05:00
|
|
|
apolloProvider,
|
2021-12-03 01:10:53 -05:00
|
|
|
provide: { groupFullPath, groupIssuesPath },
|
2021-10-29 20:10:32 -04:00
|
|
|
render(createElement) {
|
|
|
|
return createElement(CrmContactsRoot);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|