Created
July 11, 2017 09:55
-
-
Save lukeparkinson/8949cde78d7c0de2cf07dbf113838e07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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