Skip to content

Instantly share code, notes, and snippets.

@lukeparkinson
Created July 11, 2017 09:55
Show Gist options
  • Save lukeparkinson/8949cde78d7c0de2cf07dbf113838e07 to your computer and use it in GitHub Desktop.
Save lukeparkinson/8949cde78d7c0de2cf07dbf113838e07 to your computer and use it in GitHub Desktop.
import Vue from 'vue'
import App from './App.vue'
import Modal from './Modal.vue'
import VueResource from 'vue-resource'
import moment from 'moment'
import bytes from 'bytes'
Vue.use(VueResource);
Vue.component('medialibrary', App);
Vue.component('modal', Modal);
Vue.filter('formatDate', function(value) {
if (value) {
return moment(String(value)).format('MMM D, YYYY');
}
});
Vue.filter('formatFilesize', function(value) {
if (value) {
return bytes(value, {unit: 'kB'});
}
});
Vue.filter('indentPath', function(value) {
if (value) {
let indents = (value.split("/").length) - 2;
return '' + (indents > 0 ? '> '.repeat(indents) : '');
}
});
// disable before production build
//Vue.config.devtools = true;
window.vm = new Vue({
el: '#app'
});
window.Vue = Vue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment