import { createApp } from 'vue'
import App from './App.vue'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import router from '../router/index-student'
import vueFilter from '@/helpers/vueFilter'
import { postMessage } from '@/helpers/native-message'

import 'normalize.css'

import '../styles/index.less'
import { state } from '@/state'

const app = createApp(App)

// import Vconsole from 'vconsole'
// const vconsole = new Vconsole()
postMessage(
  {
    api: 'getVersion'
  },
  (res: any) => {
    state.version = res.content.version
    console.log(res, 'version')
  }
)

state.platformType = 'STUDENT'

dayjs.locale('zh-ch')
app.config.globalProperties.$dayjs = dayjs
app.config.globalProperties.$filters = vueFilter
app.use(router)

app.mount('#app')
