Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-03-26 13:20:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
43666f79df4079ddfb45f6d597bf78567865259c
43666f79
1 parent
dbbce097
feat(登录页): 添加输入框聚焦时页面平滑滚动功能
在登录页的电话输入框聚焦时,页面会自动向上平滑滚动150px,以避免输入框被键盘遮挡,提升用户体验。
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
src/views/auth/LoginPage.vue
src/views/profile/SettingsPage.vue
src/views/auth/LoginPage.vue
View file @
43666f7
...
...
@@ -28,6 +28,7 @@
type="tel"
autocomplete="tel"
required
@focus="handleInputFocus"
class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500"
/>
</div>
...
...
@@ -127,6 +128,17 @@ import FrostedGlass from "@/components/ui/FrostedGlass.vue";
import { useAuth } from "@/contexts/auth";
import { loginAPI, getUserInfoAPI } from "@/api/users";
import { useTitle } from "@vueuse/core";
const handleInputFocus = () => {
setTimeout(() => {
// 使用平滑滚动将页面向上移动200px(根据实际按钮区域高度调整)
window.scrollTo({
top: 150,
behavior: 'smooth'
});
}, 100);
};
const $route = useRoute();
useTitle($route.meta.title);
...
...
src/views/profile/SettingsPage.vue
View file @
43666f7
<!--
* @Date: 2025-03-24 13:04:21
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-26 13:0
3:11
* @LastEditTime: 2025-03-26 13:0
9:59
* @FilePath: /mlaj/src/views/profile/SettingsPage.vue
* @Description: 用户设置页面
-->
...
...
@@ -44,7 +44,7 @@
</div>
<!-- 密码设置 -->
<div class="p-4" @click="router.push('/profile/settings/password')">
<
!-- <
div class="p-4" @click="router.push('/profile/settings/password')">
<div class="flex items-center justify-between">
<div>
<h3 class="text-base font-medium text-gray-900">修改密码</h3>
...
...
@@ -52,7 +52,7 @@
</div>
<ChevronRightIcon class="w-5 h-5 text-gray-400" />
</div>
</div>
</div>
-->
<!-- 视频上传 -->
<div class="p-4" @click="router.push('/upload_video')">
...
...
Please
register
or
login
to post a comment