feat: new interface button parameters, control function display

This commit is contained in:
vben
2024-06-02 21:21:34 +08:00
parent f95cc80895
commit c5eb0841a5
12 changed files with 135 additions and 40 deletions

View File

@@ -19,14 +19,19 @@ interface Props {
* @zh_CN 是否处于加载处理状态
*/
loading?: boolean;
/**
* @zh_CN 登陆路径
*/
loginPath?: string;
}
defineOptions({
name: 'RegisterForm',
});
withDefaults(defineProps<Props>(), {
const props = withDefaults(defineProps<Props>(), {
loading: false,
loginPath: '/auth/login',
});
const emit = defineEmits<{
@@ -72,8 +77,8 @@ function handleSubmit() {
});
}
function handleGo(path: string) {
router.push(path);
function goLogin() {
router.push(props.loginPath);
}
</script>
@@ -154,7 +159,7 @@ function handleGo(path: string) {
{{ $t('authentication.already-account') }}
<span
class="text-primary hover:text-primary/80 cursor-pointer text-sm font-normal"
@click="handleGo('/auth/login')"
@click="goLogin()"
>
{{ $t('authentication.go-login') }}
</span>