import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'

//px2rem
function setHtmlFontSize() {
  const htmlWidth = document.documentElement.clientWidth || document.body.clientWidth
  const htmlDom = document.getElementsByTagName('html')[0]
  if (htmlWidth >= 500) htmlDom.style.fontSize = 500 / 10 + 'px'
  else htmlDom.style.fontSize = htmlWidth / 10 + 'px'
}
setHtmlFontSize();
onresize = setHtmlFontSize

Vue.config.productionTip = false

import VueCropper from 'vue-cropper' 
Vue.use(VueCropper)

// icon-loader
import Icon from 'vue-svg-icon/Icon.vue'
Vue.component('icon', Icon);

import CustedLogo from './components/Logo.vue'
Vue.component('custedLogo', CustedLogo)

// 自己写的snakebar组件
import SnakeBar from '@/components/SnakeBar/index'
Vue.use(SnakeBar)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
