feat(components): 在登录和注册页面添加返回首页按钮

- 在 LoginPage.vue 和 RegisterPage.vue 中添加返回首页按钮
- 实现 goToHome 方法,用于跳转到首页- 优化用户操作流程,提供更便捷的页面导航
This commit is contained in:
ikmkj
2025-07-31 18:25:57 +08:00
parent 0f989d1d6b
commit a7cb3dc2c7
2 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
<el-form-item>
<el-button type="primary" @click="handleLogin">登录</el-button>
<el-button @click="goToRegister">注册</el-button>
<el-button @click="goToHome">返回首页</el-button>
</el-form-item>
</el-form>
</el-card>
@@ -58,6 +59,10 @@ const handleLogin = async () => {
const goToRegister = () => {
router.push('/register');
};
const goToHome = () => {
router.push('/home');
};
</script>
<style scoped>

View File

@@ -19,6 +19,7 @@
<el-form-item>
<el-button type="primary" @click="handleRegister">注册</el-button>
<el-button @click="goToLogin">返回登录</el-button>
<el-button @click="goToHome">返回首页</el-button>
</el-form-item>
</el-form>
</el-card>
@@ -72,6 +73,10 @@ const handleRegister = async () => {
const goToLogin = () => {
router.push('/login');
};
const goToHome = () => {
router.push('/home');
};
</script>
<style scoped>