mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
28 lines
565 B
TypeScript
28 lines
565 B
TypeScript
import { setupStore } from '../../src/store'
|
|
import { setupRouter } from '../../src/router'
|
|
import { setupI18n } from '../../src/locales'
|
|
import renderHook from '../utils/renderHook'
|
|
|
|
/**
|
|
*
|
|
* @description
|
|
* 初始化 mini ray template 应用环境。
|
|
* 该方法会初始化 store、router、i18n 等环境。
|
|
*
|
|
* @example
|
|
* const { app } = await setupMiniApp()
|
|
*/
|
|
const setupMiniApp = async () => {
|
|
const [_, app] = renderHook(() => {})
|
|
|
|
setupStore(app)
|
|
setupRouter(app)
|
|
await setupI18n(app)
|
|
|
|
return {
|
|
app,
|
|
}
|
|
}
|
|
|
|
export default setupMiniApp
|