feat(components): 在登录和注册页面添加返回首页按钮
- 在 LoginPage.vue 和 RegisterPage.vue 中添加返回首页按钮 - 实现 goToHome 方法,用于跳转到首页- 优化用户操作流程,提供更便捷的页面导航
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleLogin">登录</el-button>
|
<el-button type="primary" @click="handleLogin">登录</el-button>
|
||||||
<el-button @click="goToRegister">注册</el-button>
|
<el-button @click="goToRegister">注册</el-button>
|
||||||
|
<el-button @click="goToHome">返回首页</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -58,6 +59,10 @@ const handleLogin = async () => {
|
|||||||
const goToRegister = () => {
|
const goToRegister = () => {
|
||||||
router.push('/register');
|
router.push('/register');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const goToHome = () => {
|
||||||
|
router.push('/home');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleRegister">注册</el-button>
|
<el-button type="primary" @click="handleRegister">注册</el-button>
|
||||||
<el-button @click="goToLogin">返回登录</el-button>
|
<el-button @click="goToLogin">返回登录</el-button>
|
||||||
|
<el-button @click="goToHome">返回首页</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -72,6 +73,10 @@ const handleRegister = async () => {
|
|||||||
const goToLogin = () => {
|
const goToLogin = () => {
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const goToHome = () => {
|
||||||
|
router.push('/home');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user