mobilizon/js/src/main.ts

42 lines
1.1 KiB
TypeScript
Raw Normal View History

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
// import * as VueGoogleMaps from 'vue2-google-maps';
import VueSimpleMarkdown from 'vue-simple-markdown';
import Buefy from 'buefy'
import 'buefy/dist/buefy.css';
import GetTextPlugin from 'vue-gettext';
import App from '@/App.vue';
import router from '@/router';
2019-01-18 13:47:10 +00:00
import { apolloProvider } from './vue-apollo';
const translations = require('@/i18n/translations.json');
Vue.config.productionTip = false;
Vue.use(VueSimpleMarkdown);
Vue.use(Buefy, {
defaultContainerElement: '#mobilizon'
});
const language = (window.navigator as any).userLanguage || window.navigator.language;
2019-01-11 14:55:55 +00:00
Vue.filter('formatDate', value => value ? new Date(value).toLocaleString() : null);
Vue.filter('formatDay', value => value ? new Date(value).toLocaleDateString() : null);
Vue.use(GetTextPlugin, {
translations,
defaultLanguage: 'en_US',
});
Vue.config.language = language.replace('-', '_');
/* eslint-disable no-new */
new Vue({
router,
el: '#app',
template: '<App/>',
2019-01-18 13:47:10 +00:00
apolloProvider,
components: { App },
});