2018-11-27 15:10:40 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
2019-02-22 12:54:06 +00:00
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2018-11-27 15:10:40 +00:00
|
|
|
import App from './components/app.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2020-12-23 12:10:26 +00:00
|
|
|
export default function () {
|
2018-11-27 15:10:40 +00:00
|
|
|
const el = document.getElementById('js-suggestions');
|
|
|
|
const issueTitle = document.getElementById('issue_title');
|
|
|
|
const { projectPath } = el.dataset;
|
|
|
|
const apolloProvider = new VueApollo({
|
2019-02-22 12:54:06 +00:00
|
|
|
defaultClient: createDefaultClient(),
|
2018-11-27 15:10:40 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
apolloProvider,
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
search: issueTitle.value,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
issueTitle.addEventListener('input', () => {
|
|
|
|
this.search = issueTitle.value;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
render(h) {
|
|
|
|
return h(App, {
|
|
|
|
props: {
|
|
|
|
projectPath,
|
|
|
|
search: this.search,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|