import App from './App'
import './permission'
import languages from './locale/index'
import {
	setupPinia
} from './store';
import {
	createSSRApp
} from 'vue'

import {
	createI18n
} from 'vue-i18n'
let i18nConfig = {
	locale: uni.getLocale(),
	messages: languages
}


const i18n = createI18n(i18nConfig)
export function createApp() {
	const app = createSSRApp(App)
	setupPinia(app)
	app.use(i18n)
	// 把t函数添加到全局属性
	app.config.globalProperties.$t = i18n.global.t

	return {
		app,
	}
}