2023-04-23 21:23:45 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import VueRouter from 'vue-router';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
|
|
|
import routes from './routes';
|
|
|
|
import App from './components/app.vue';
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
export const initCommentTemplates = () => {
|
2023-04-23 21:23:45 +05:30
|
|
|
Vue.use(VueApollo);
|
|
|
|
Vue.use(VueRouter);
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
const el = document.getElementById('js-comment-templates-root');
|
2023-04-23 21:23:45 +05:30
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
const router = new VueRouter({
|
|
|
|
base: el.dataset.basePath,
|
|
|
|
mode: 'history',
|
|
|
|
routes,
|
|
|
|
});
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
router,
|
|
|
|
apolloProvider,
|
|
|
|
render(h) {
|
|
|
|
return h(App);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|