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-30 13:05:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff4dc7ad987c3f0b96637f74992ced8ba3398e1c
ff4dc7ad
1 parent
42bfdddc
fix 键盘弹出框高度
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
18 deletions
src/components/IdentityField/index.vue
src/components/NumberField/index.vue
src/components/PhoneField/index.vue
src/components/IdentityField/index.vue
View file @
ff4dc7a
...
...
@@ -64,16 +64,27 @@ watch(
);
const openKeyboard = (e) => {
// // 键盘上移动
// const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
// const target_top = document.body.scrollHeight - $(e.target).offset().top; // 元素到正文高度
// let scroll_height = "";
// console.warn(target_top);
// if (target_top < 250) {
// document.getElementById("app").style.paddingBottom = "250px";
// window.scrollTo(0, $("#app").height());
// } else {
// // 向上滚动位置
// document.documentElement.scrollTop = (target_top > 250 ? 0 : target_top) + 250;
// }
// 键盘上移动
const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
const target_to_view_height =
window.innerHeight - e.target.getBoundingClientRect().bottom; // 元素到适口高度
const target_top = document.body.scrollHeight - $(e.target).offset().top; // 元素到正文高度
let scroll_height = "";
if (target_top < 244) {
document.getElementById("app").style.paddingBottom = "244px";
window.scrollTo(0, $("#app").height());
} else {
if (target_to_view_height <= 250) {
document.getElementById("app").style.paddingBottom = "250px";
// 向上滚动位置
document.documentElement.scrollTop =
target_top +
244;
document.documentElement.scrollTop =
$(e.target).offset().top -
244;
}
// 选中添加border颜色
content = $(e.target).parent();
...
...
src/components/NumberField/index.vue
View file @
ff4dc7a
...
...
@@ -77,16 +77,21 @@ watch(
const showKeyboard = (e) => {
// 键盘上移动
// const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
const target_to_view_height =
window.innerHeight - e.target.getBoundingClientRect().bottom; // 元素到适口高度
const target_top = document.body.scrollHeight - $(e.target).offset().top; // 元素到正文高度
let scroll_height = "";
document.getElementById("app").style.paddingBottom = "244px";
if (target_top < 244) {
window.scrollTo(0, $("#app").height());
} else {
if (target_to_view_height <= 250) {
document.getElementById("app").style.paddingBottom = "250px";
// 向上滚动位置
document.documentElement.scrollTop =
target_top +
244;
document.documentElement.scrollTop =
$(e.target).offset().top -
244;
}
// if (target_top < 250) {
// window.scrollTo(0, $("#app").height());
// } else {
// // 向上滚动位置
// document.documentElement.scrollTop = (target_top > 500 ? 0 : target_top) + 250;
// }
// 选中添加border颜色
content = $(e.target).parent();
// TAG: 自定义主题颜色
...
...
src/components/PhoneField/index.vue
View file @
ff4dc7a
...
...
@@ -87,15 +87,14 @@ watch(
const openKeyboard = (e) => {
// 键盘上移动
const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
const target_to_view_height =
window.innerHeight - e.target.getBoundingClientRect().bottom; // 元素到适口高度
const target_top = document.body.scrollHeight - $(e.target).offset().top; // 元素到正文高度
let scroll_height = "";
if (target_top < 244) {
document.getElementById("app").style.paddingBottom = "244px";
window.scrollTo(0, $("#app").height());
} else {
if (target_to_view_height <= 250) {
document.getElementById("app").style.paddingBottom = "250px";
// 向上滚动位置
document.documentElement.scrollTop =
target_top +
244;
document.documentElement.scrollTop =
$(e.target).offset().top -
244;
}
// 选中添加border颜色
content = $(e.target).parent();
...
...
Please
register
or
login
to post a comment