深入 Vben Admin
登录部分
1、运行
使用指令
yarn serve
执行 Local: http://localhost:3100/
此时的路径为http://localhost:3100/#/login?redirect=/dashboard/analysis
2、参与
3、详解
一、main.ts
问题 | 解答 |
---|
什么是 main.ts | 程序入口文件 | 有什么用 | 初始化vue实例并使用需要的 插件 , 加载各种 公共组件 |
引入
import '/@/design/index.less';
import 'virtual:windi-base.css';
import 'virtual:windi-components.css';
import 'virtual:windi-utilities.css';
import 'virtual:svg-icons-register';
import App from './App.vue';
import { createApp } from 'vue';
import { initAppConfigStore } from '/@/logics/initAppConfig';
import { setupErrorHandle } from '/@/logics/error-handle';
import { router, setupRouter } from '/@/router';
import { setupRouterGuard } from '/@/router/guard';
import { setupStore } from '/@/store';
import { setupGlobDirectives } from '/@/directives';
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
定义
if (import.meta.env.DEV) {
import('ant-design-vue/dist/antd.less');
}
async function bootstrap() {
const app = createApp(App);
setupStore(app);
initAppConfigStore();
registerGlobComp(app);
await setupI18n(app);
setupRouter(app);
setupRouterGuard(router);
setupGlobDirectives(app);
setupErrorHandle(app);
app.mount('#app');
}
bootstrap();
二、 index.ts
三、 LoginForm.vue
|