Download apps/web-ele/src/main.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 945 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/web-ele/src/main.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/apps/web-ele/src/main.ts
-
curl -L -o main.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/web-ele/src/main.ts
945 Bytes
| import { initPreferences } from '@vben/preferences'; | |
| import { unmountGlobalLoading } from '@vben/utils'; | |
| import { overridesPreferences } from './preferences'; | |
| /** | |
| * 应用初始化完成之后再进行页面加载渲染 | |
| */ | |
| async function initApplication() { | |
| // name用于指定项目唯一标识 | |
| // 用于区分不同项目的偏好设置以及存储数据的key前缀以及其他一些需要隔离的数据 | |
| const env = import.meta.env.PROD ? 'prod' : 'dev'; | |
| const appVersion = import.meta.env.VITE_APP_VERSION; | |
| const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${appVersion}-${env}`; | |
| // app偏好设置初始化 | |
| await initPreferences({ | |
| namespace, | |
| overrides: overridesPreferences, | |
| }); | |
| // 启动应用并挂载 | |
| // vue应用主要逻辑及视图 | |
| const { bootstrap } = await import('./bootstrap'); | |
| await bootstrap(namespace); | |
| // 移除并销毁loading | |
| unmountGlobalLoading(); | |
| } | |
| initApplication(); | |