import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import element from '@/common/components/element-ui.js'
import vxeTable from '@/common/components/vxeTable.js'
import './common/style/index.scss'

Vue.config.productionTip = false

Vue.use(element)
Vue.use(vxeTable)

router.afterEach((to, from) => {
  if (to.path === '/login') return
  store.commit('tags/add', {
    name: to.name,
    path: to.fullPath,
    title: to.meta?.title || to.name,
  })
  store.commit('tags/setActive', to.name)
})

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