1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import Vue from 'vue';
import ErrorMessage from './components/error_message.vue';
document.addEventListener('DOMContentLoaded', () => {
const { environment, offlineVersions, archivesPath } = document.getElementById(
'offline-versions',
).dataset;
const location = window.location.href;
const isOffline = offlineVersions.split(',').find(version => location.includes(version));
return new Vue({
el: '#js-error-message',
components: {
ErrorMessage,
},
render(createElement) {
return createElement(ErrorMessage, {
provide: {
archivesPath,
},
props: {
isOffline: Boolean(isOffline),
isProduction: environment === 'production',
},
});
},
});
});
|