feat: new interface button parameters, control function display
This commit is contained in:
@@ -12,14 +12,19 @@ interface Props {
|
||||
* @zh_CN 是否处于加载处理状态
|
||||
*/
|
||||
loading?: boolean;
|
||||
/**
|
||||
* @zh_CN 登陆路径
|
||||
*/
|
||||
loginPath?: string;
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: 'AuthenticationForgetPassword',
|
||||
});
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
loading: false,
|
||||
loginPath: '/auth/login',
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -44,8 +49,8 @@ function handleSubmut() {
|
||||
emit('submit', formState.email);
|
||||
}
|
||||
|
||||
function handleGo(path: string) {
|
||||
router.push(path);
|
||||
function goLogin() {
|
||||
router.push(props.loginPath);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -73,11 +78,7 @@ function handleGo(path: string) {
|
||||
<VbenButton class="mt-2 w-full" @click="handleSubmut">
|
||||
{{ $t('authentication.send-reset-link') }}
|
||||
</VbenButton>
|
||||
<VbenButton
|
||||
class="mt-4 w-full"
|
||||
variant="outline"
|
||||
@click="handleGo('/auth/login')"
|
||||
>
|
||||
<VbenButton class="mt-4 w-full" variant="outline" @click="goLogin()">
|
||||
{{ $t('common.back') }}
|
||||
</VbenButton>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user