1、刚刚开始使用的是view组件,给定了高度,超出部分y轴滚动,微信小程序模拟器上面一直为正常
代码如下:
<template>
<tn-popup v-model="show"
safeAreaInsetBottom
mode="bottom"
closeBtn
@close="handleClose"
:maskCloseable="false"
height="70vh"
>
<view class="music-container">
<view class="music-list"></view>
</view>
</tn-popup>
</template>
<style scoped lang="scss">
.music-list {
max-height: 60vh; // 给定固定高度
overflow-y: scroll; // y轴滚动
}
</style>
2、为了适配真机,在view组件外边套用了scroll-view,利用该组件中的组件配置滚动
<template>
<tn-popup v-model="show"
safeAreaInsetBottom
mode="bottom"
height="1200rpx"
@close="handleClose">
<view class="music-container">
<scroll-view scroll-y style="height: 1050rpx;">
<view class="music-list"></view>
</scroll-view>
</view>
</tn-popup>
</template>