chore: move filters into their own file

This commit is contained in:
2018-09-17 18:08:23 -07:00
parent 85efbd84d1
commit 3154b1e014
2 changed files with 13 additions and 11 deletions

View File

@@ -1,19 +1,9 @@
import Vue from 'vue';
import Router from 'vue-router';
import './filters.mjs';
Vue.use(Router);
Vue.filter('capitalize', value => {
if (!value) return '';
const v = value.toString();
return v.charAt(0).toUpperCase() + v.slice(1);
});
Vue.filter('round', (value, digits = 2) => {
const v = parseFloat(value, 10);
return Math.round(v * (10 * digits)) / (10 * digits);
});
const router = new Router({
mode: 'history',
routes: [