feat(components): 在登录和注册页面添加返回首页按钮
- 在 LoginPage.vue 和 RegisterPage.vue 中添加返回首页按钮 - 实现 goToHome 方法,用于跳转到首页- 优化用户操作流程,提供更便捷的页面导航
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user