web/src/main.js

34 lines
874 B
JavaScript

// 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 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import App from './App'
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue);
Vue.component('formatBytes', {
render: function (createElement) {
return createElement(
'span', formatBytes(this.bytes)
)
},
props: {
bytes: {
required: false
}
}
});
function formatBytes(a,b){if(0==a)return"0 Bytes";var c=1024,d=b||2,e=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],f=Math.floor(Math.log(a)/Math.log(c));return parseFloat((a/Math.pow(c,f)).toFixed(d))+" "+e[f]}
Vue.config.productionTip = true;
/* eslint-disable no-new */
new Vue({
el: '#app',
render: h => h(App)
});