import { createSSRApp } from 'vue'
import App from './App.vue'
import store from './store'
// import store from './store'
import dayjs from 'dayjs'
import modal from './modal.ts' // plugins
import uViewNext from 'uview-next'
//import 'uview-next/styles/index.scss' // 引入全局样式
// import util from '@/utils/util'
// uni.$util = util

import { goToPage } from './utils/util'

export function createApp() {
  const app = createSSRApp(App)

  uni.goToPage = goToPage

  // 定义全局属性
  app.config.globalProperties.$dayjs = dayjs
  app.config.globalProperties.$modal = modal
  app.config.globalProperties.$debouncemss = 600 //防抖时间
  app.use(uViewNext) // 注册组件库

  app.use(store)

  return {
    app
  }
}
