Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-11-29 15:45:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3a04f5762f24dca7d9b6a0e5eb180b55f5f65886
3a04f576
1 parent
0ae86873
fix 动态计算弹出框高度
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
src/components/IdentityField/index.vue
src/components/IdentityField/index.vue
View file @
3a04f57
...
...
@@ -18,7 +18,7 @@
:rules="rules"
:required="item.component_props.required"
readonly
@touchstart.stop="openKeyboard()"
@touchstart.stop="openKeyboard(
$event
)"
:border="false"
>
</van-field>
...
...
@@ -41,11 +41,17 @@ const props = defineProps({
const show = ref(false);
const openKeyboard = () => {
const openKeyboard = (
e
) => {
show.value = true;
// 键盘上移动
document.body.style.paddingBottom = "100px";
document.documentElement.scrollTop = 100;
const height =
window.innerHeight -
e.target.getBoundingClientRect().y -
e.target.getBoundingClientRect().height +
50;
document.body.style.paddingBottom = height + "px";
document.documentElement.scrollTop = height;
console.warn(height);
};
const blurKeyboard = () => {
show.value = false;
...
...
Please
register
or
login
to post a comment