refactor: refactor AuthLayout to configure the login page more freely (#4294)
This commit is contained in:
@@ -240,7 +240,7 @@ const defaultPreferences: Preferences = {
|
||||
theme: {
|
||||
builtinType: 'default',
|
||||
colorDestructive: 'hsl(348 100% 61%)',
|
||||
colorPrimary: 'hsl(231 98% 65%)',
|
||||
colorPrimary: 'hsl(212 100% 45%)',
|
||||
colorSuccess: 'hsl(144 57% 58%)',
|
||||
colorWarning: 'hsl(42 84% 61%)',
|
||||
mode: 'dark',
|
||||
|
@@ -18,7 +18,7 @@ You just need to configure the `props` parameter of `AuthPageLayout` in `src/rou
|
||||
pageTitle: "开箱即用的大型中后台管理系统",
|
||||
pageDescription: "工程化、高性能、跨组件库的前端模版",
|
||||
toolbar: true,
|
||||
toolbarList: () => ['color', 'language', 'layout', 'theme'],
|
||||
toolbarList: ['color', 'language', 'layout', 'theme'],
|
||||
}
|
||||
// ...
|
||||
},
|
||||
|
@@ -53,7 +53,7 @@ You can check the list below to understand all the available variables.
|
||||
|
||||
/* Theme Colors */
|
||||
|
||||
--primary: 231 98% 65%;
|
||||
--primary: 212 100% 45%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
/* Used for destructive actions such as <Button variant="destructive"> */
|
||||
@@ -264,7 +264,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
// Error color
|
||||
colorDestructive: 'hsl(348 100% 61%)',
|
||||
// Primary color
|
||||
colorPrimary: 'hsl(231 98% 65%)',
|
||||
colorPrimary: 'hsl(212 100% 45%)',
|
||||
// Success color
|
||||
colorSuccess: 'hsl(144 57% 58%)',
|
||||
// Warning color
|
||||
@@ -351,7 +351,7 @@ type BuiltinThemeType =
|
||||
|
||||
/* Theme Colors */
|
||||
|
||||
--primary: 231 98% 65%;
|
||||
--primary: 212 100% 45%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
/* Used for destructive actions such as <Button variant="destructive"> */
|
||||
|
@@ -262,7 +262,7 @@ const defaultPreferences: Preferences = {
|
||||
theme: {
|
||||
builtinType: 'default',
|
||||
colorDestructive: 'hsl(348 100% 61%)',
|
||||
colorPrimary: 'hsl(231 98% 65%)',
|
||||
colorPrimary: 'hsl(212 100% 45%)',
|
||||
colorSuccess: 'hsl(144 57% 58%)',
|
||||
colorWarning: 'hsl(42 84% 61%)',
|
||||
mode: 'dark',
|
||||
|
@@ -8,28 +8,21 @@
|
||||
|
||||

|
||||
|
||||
只需要在应用下的 `src/router/routes/core.ts` 内,配置`AuthPageLayout`的 `props`参数即可:
|
||||
只需要在应用下的 `src/layouts/auth.vue` 内,配置`AuthPageLayout`的 `props`参数即可:
|
||||
|
||||
```ts {4-8}
|
||||
{
|
||||
component: AuthPageLayout,
|
||||
props: {
|
||||
sloganImage: "xxx/xxx.png",
|
||||
pageTitle: "开箱即用的大型中后台管理系统",
|
||||
pageDescription: "工程化、高性能、跨组件库的前端模版",
|
||||
toolbar: true,
|
||||
toolbarList: () => ['color', 'language', 'layout', 'theme'],
|
||||
}
|
||||
// ...
|
||||
},
|
||||
```vue {2-7}
|
||||
<AuthPageLayout
|
||||
:copyright="true"
|
||||
:toolbar="true"
|
||||
:toolbarList="['color', 'language', 'layout', 'theme']"
|
||||
:app-name="appName"
|
||||
:logo="logo"
|
||||
:page-description="$t('authentication.pageDesc')"
|
||||
:page-title="$t('authentication.pageTitle')"
|
||||
>
|
||||
</AuthPageLayout>
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
如果这些配置不能满足你的需求,你可以自行实现登录页面。直接实现自己的 `AuthPageLayout`即可。
|
||||
|
||||
:::
|
||||
|
||||
## 登录表单调整
|
||||
|
||||
如果你想调整登录表单的相关内容,你可以在应用下的 `src/views/_core/authentication/login.vue` 内,配置`AuthenticationLogin` 组件参数即可:
|
||||
|
@@ -53,7 +53,7 @@ css 变量内的颜色,必须使用 `hsl` 格式,如 `0 0% 100%`,不需要
|
||||
|
||||
/* 主题颜色 */
|
||||
|
||||
--primary: 231 98% 65%;
|
||||
--primary: 212 100% 45%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
/* Used for destructive actions such as <Button variant="destructive"> */
|
||||
@@ -264,7 +264,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
// 错误色
|
||||
colorDestructive: 'hsl(348 100% 61%)',
|
||||
// 主题色
|
||||
colorPrimary: 'hsl(231 98% 65%)',
|
||||
colorPrimary: 'hsl(212 100% 45%)',
|
||||
// 成功色
|
||||
colorSuccess: 'hsl(144 57% 58%)',
|
||||
// 警告色
|
||||
@@ -351,7 +351,7 @@ type BuiltinThemeType =
|
||||
|
||||
/* 主题颜色 */
|
||||
|
||||
--primary: 231 98% 65%;
|
||||
--primary: 212 100% 45%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
/* Used for destructive actions such as <Button variant="destructive"> */
|
||||
|
Reference in New Issue
Block a user