2017-04-05 21:13:06 -04:00
|
|
|
import Vue from 'vue';
|
2018-08-23 16:53:35 -04:00
|
|
|
import sanitize from 'sanitize-html';
|
2017-05-10 07:29:33 -04:00
|
|
|
import issuableApp from './components/app.vue';
|
2017-04-05 21:13:06 -04:00
|
|
|
import '../vue_shared/vue_resource_interceptor';
|
|
|
|
|
2018-08-23 16:53:35 -04:00
|
|
|
export default function initIssueableApp() {
|
2017-05-15 09:51:40 -04:00
|
|
|
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
|
2018-08-23 16:53:35 -04:00
|
|
|
const props = JSON.parse(sanitize(initialDataEl.textContent).replace(/"/g, '"'));
|
2017-05-18 08:24:34 -04:00
|
|
|
|
2017-05-12 05:11:15 -04:00
|
|
|
return new Vue({
|
|
|
|
el: document.getElementById('js-issuable-app'),
|
|
|
|
components: {
|
|
|
|
issuableApp,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('issuable-app', {
|
2017-12-07 12:52:32 -05:00
|
|
|
props,
|
2017-05-12 05:11:15 -04:00
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
2018-08-23 16:53:35 -04:00
|
|
|
}
|