Browse Source

fix: 虚拟键盘智能显示

master
guoapeng 2 weeks ago
parent
commit
d9f65a3c67
  1. 4
      src/components/common/FTInput/index.vue
  2. 4
      src/components/home/Environment.vue

4
src/components/common/FTInput/index.vue

@ -59,7 +59,9 @@ const open = () => {
const focusInput = (e: any) => { const focusInput = (e: any) => {
const rect = e.target.getBoundingClientRect() const rect = e.target.getBoundingClientRect()
if (rect.top + window.scrollY > 800) {
const scrollTop = window.scrollY || document.documentElement.scrollTop
console.log(rect.top + scrollTop)
if (window.innerHeight - rect.bottom < 300) {
placement.value = 'top' placement.value = 'top'
} }
else { else {

4
src/components/home/Environment.vue

@ -45,8 +45,8 @@ const imgs: Record<string, any> = {
const titles: Record<string, any> = { const titles: Record<string, any> = {
Internal: '仓内', Internal: '仓内',
WiredExtSensor: '外接',
WirelessExtSensor: '无线',
WiredExtSensor: '探头',
WirelessExtSensor: '探头',
} }
/** /**
* @hook 生命周期钩子 - 组件挂载完成时执行 * @hook 生命周期钩子 - 组件挂载完成时执行

Loading…
Cancel
Save