import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import { initStore, initSession } from './utils/init'

// import 'amfe-flexible'
import 'vant/lib/index.css'

import './assets/css/normalize.css'
import './assets/css/style.css'
import './assets/css/common.less'

import { VueClipboard } from '@soerenmartius/vue3-clipboard'

import Hammer from 'hammerjs'

const app = createApp(App)

app.directive('swipeleft', {
    beforeMount(el, binding) {
      const hammerTest = new Hammer(el);
      hammerTest.on("swipeleft", binding.value);    
    }
})

app.directive('swiperight', {
    beforeMount(el, binding) {
      const hammerTest = new Hammer(el);
      hammerTest.on("swiperight", binding.value);    
    }
})

app.use(router).use(store);

initSession();

await initStore()
  
app.use(VueClipboard)
app.mount('#app')

