import Vue from 'vue'
import App from './App.vue'
import store from '@/store'
import VueClipboard from 'vue-clipboard2'
import Avatar from '@/components/popup/avatar'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
import VueVirtualScroller from 'vue-virtual-scroller'
import imgPreview from '@/components/popup/imgPreview'
import packetGet from '@/components/popup/packetGet'
import packetSend from '@/components/popup/packetSend'
import otherInfo from '@/components/popup/otherInfo'
import Info from '@/components/popup/userInfo'
import TWEEN from '@tweenjs/tween.js'
import Toast from '@/components/popup/toast'
import i18n from '@/util/lang/lang'
import { Loading } from 'element-ui'
// 全局自定义插件
import '@/plugins/directive'

Vue.use(Avatar, store)
Vue.use(VueClipboard)
Vue.use(VueVirtualScroller)
Vue.use(imgPreview)
Vue.use(Info, store)
Vue.use(otherInfo, store)
Vue.use(packetGet, store)
Vue.use(packetSend, store)
Vue.use(Toast)
Vue.use(Loading)

Vue.config.productionTip = false

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

// Setup the animation loop.
function animate (time) {
  requestAnimationFrame(animate)
  TWEEN.update(time)
}
requestAnimationFrame(animate)
