更改前代码如下:

<template>
  <view class="pageContent">
    <slot></slot>
    <u-safe-bottom v-if="!props.formHome"></u-safe-bottom>
    <FloatBtn v-if="!props.formHome && !dontShowFloatBtn"></FloatBtn>
  </view>
</template>

<style lang="scss" scoped>
.pageContent {
  background: #ffff;
  font-family: PingFangSC, PingFangSC-Regular;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
</style>

更改后代码如下:

<template>
  <scroll-view scroll-y enable-flex class="pageContent">
    <slot></slot>
    <u-safe-bottom v-if="!props.formHome"></u-safe-bottom>
    <FloatBtn v-if="!props.formHome && !dontShowFloatBtn"></FloatBtn>
  </scroll-view>
</template>

<style lang="scss" scoped>
.pageContent {
  background: #ffff;
  font-family: PingFangSC, PingFangSC-Regular;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y:scroll;
  overflow-x:hidden;
}
</style>

主要就是将view改为scroll-view,这样不仅能解决解决提示文字被推上去的问题,弹起的键盘也能正常把页面推上去

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐