uniapp中popup弹窗高度过大无法滚动的问题

解决方法:使用scroll-view包裹住控件

<uni-popup ref="barcode" background-color="#fff" @change="change">
  <view class="popup-content" style="height: auto;">

  <scroll-view scroll-y="true" style="max-height: 50vh;">

  <uni-table ref="table4" type="selection" :loading="loadingTable4" border stripe emptyText="暂无更多数据" @selection-change="selectionChange3">
    <uni-tr>
      <uni-th width="150" align="center">序号</uni-th>
      <uni-th width="150" align="center">员工编码</uni-th>
      <uni-th width="150" align="center">员工名称</uni-th>
    </uni-tr>
    <uni-tr v-for="(item, index) in tableData4" :key="index">
      <uni-td align="center">{{ index + 1 }}</uni-td>
      <uni-td align="center">{{ item.ygbm}}</uni-td>
      <uni-td align="center">{{ item.gymc }}</uni-td>
    </uni-tr>
  </uni-table>

  </scroll-view>

  </view>
</uni-popup>

最终结果,出现弹窗中的滚动条

 

posted @ 2025-04-04 10:02  妞妞猪  阅读(449)  评论(0)    收藏  举报