main.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019-2022 Hackware SpA <human@hackware.cl>
  2. // This file is part of "Hackware Userland" and licensed under the terms
  3. // of the GNU Affero General Public License version 3, or (at your option)
  4. // a later version. You should have received a copy of this license along
  5. // with the software. If not, see <https://www.gnu.org/licenses/>.
  6. import '@fortawesome/fontawesome-free/css/all.css';
  7. import Vue from 'vue';
  8. import App from './App.vue';
  9. import router from './router';
  10. import Auth from './Auth';
  11. import Fetcher from './Fetcher';
  12. import './filters';
  13. Vue.prototype.$fetcher = new Fetcher(process.env.VUE_APP_HAWESE_ENDPOINT);
  14. Vue.prototype.$auth = new Auth(Vue.prototype.$fetcher);
  15. Vue.prototype.$eventHub = new Vue(); // This looks like Vuex
  16. Vue.config.productionTip = false;
  17. Vue.prototype.$filters = {
  18. currency(amount, currency, explicit = false) {
  19. const currencyFormatter = new Intl.NumberFormat(undefined, {
  20. style: 'currency',
  21. currencyDisplay: 'narrowSymbol',
  22. currency,
  23. });
  24. return currencyFormatter.format(amount) + (explicit ? ` ${currency}` : '');
  25. },
  26. };
  27. new Vue({
  28. router,
  29. render: h => h(App),
  30. }).$mount('#app');