Browse Source
feat(authentication): 二维码登录和验证码登录组件增加返回按钮显隐配置 (#6713)
- 在 CodeLogin 和 QrcodeLogin 组件中添加 showBack 属性
- 根据 showBack 属性决定是否显示返回按钮
- 默认值为 true,即默认显示返回按钮
pull/6744/head
oc
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
2 deletions
-
packages/effects/common-ui/src/ui/authentication/code-login.vue
-
packages/effects/common-ui/src/ui/authentication/qrcode-login.vue
|
|
@ -35,6 +35,10 @@ interface Props { |
|
|
* @zh_CN 按钮文本 |
|
|
* @zh_CN 按钮文本 |
|
|
*/ |
|
|
*/ |
|
|
submitButtonText?: string; |
|
|
submitButtonText?: string; |
|
|
|
|
|
/** |
|
|
|
|
|
* @zh_CN 是否显示返回按钮 |
|
|
|
|
|
*/ |
|
|
|
|
|
showBack?: boolean; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
defineOptions({ |
|
|
defineOptions({ |
|
|
@ -43,6 +47,7 @@ defineOptions({ |
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), { |
|
|
const props = withDefaults(defineProps<Props>(), { |
|
|
loading: false, |
|
|
loading: false, |
|
|
|
|
|
showBack: true, |
|
|
loginPath: '/auth/login', |
|
|
loginPath: '/auth/login', |
|
|
submitButtonText: '', |
|
|
submitButtonText: '', |
|
|
subTitle: '', |
|
|
subTitle: '', |
|
|
@ -110,7 +115,7 @@ defineExpose({ |
|
|
{{ submitButtonText || $t('common.login') }} |
|
|
{{ submitButtonText || $t('common.login') }} |
|
|
</slot> |
|
|
</slot> |
|
|
</VbenButton> |
|
|
</VbenButton> |
|
|
<VbenButton class="mt-4 w-full" variant="outline" @click="goToLogin()"> |
|
|
<VbenButton v-if="showBack" class="mt-4 w-full" variant="outline" @click="goToLogin()"> |
|
|
{{ $t('common.back') }} |
|
|
{{ $t('common.back') }} |
|
|
</VbenButton> |
|
|
</VbenButton> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
@ -35,6 +35,10 @@ interface Props { |
|
|
* @zh_CN 描述 |
|
|
* @zh_CN 描述 |
|
|
*/ |
|
|
*/ |
|
|
description?: string; |
|
|
description?: string; |
|
|
|
|
|
/** |
|
|
|
|
|
* @zh_CN 是否显示返回按钮 |
|
|
|
|
|
*/ |
|
|
|
|
|
showBack?: boolean; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
defineOptions({ |
|
|
defineOptions({ |
|
|
@ -44,6 +48,7 @@ defineOptions({ |
|
|
const props = withDefaults(defineProps<Props>(), { |
|
|
const props = withDefaults(defineProps<Props>(), { |
|
|
description: '', |
|
|
description: '', |
|
|
loading: false, |
|
|
loading: false, |
|
|
|
|
|
showBack: true, |
|
|
loginPath: '/auth/login', |
|
|
loginPath: '/auth/login', |
|
|
submitButtonText: '', |
|
|
submitButtonText: '', |
|
|
subTitle: '', |
|
|
subTitle: '', |
|
|
@ -88,7 +93,7 @@ function goToLogin() { |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<VbenButton class="mt-4 w-full" variant="outline" @click="goToLogin()"> |
|
|
<VbenButton v-if="showBack" class="mt-4 w-full" variant="outline" @click="goToLogin()"> |
|
|
{{ $t('common.back') }} |
|
|
{{ $t('common.back') }} |
|
|
</VbenButton> |
|
|
</VbenButton> |
|
|
</div> |
|
|
</div> |
|
|
|