在uniapp 中 uni-popup 内容过多的时候 滚动不了的问题

我在用这个组件的时候,发现,限制一定的高度,如果内容太多,就会滚定不了,卡在哪里,如果不给高度,内容就会撑开满屏的状态,然后找了很多方法,也算找到了 

<template>
  <view class="container_box">
    <uni-popup ref="isMusicpopup" type="bottom">
      <view class="content_list">
        <scroll-view scroll-y="true" class="scroll_view_style">
          <view class="title_up">
            <text class="title_up_item" @click="onCurrentNumber(0)"
              :class="{'title_up_item_active':CurrentIndex==0}">景点</text>
            <text class="title_up_item" @click="onCurrentNumber(1)"
              :class="{'title_up_item_active':CurrentIndex==1}">传说</text>
            <text class="title_up_item" @click="onCurrentNumber(2)"
              :class="{'title_up_item_active':CurrentIndex==2}">珍宝馆
            </text>
          </view>
          <view class="audio_box">
            {{childAudioArray}}
          </view>
        </scroll-view>
      </view>
    </uni-popup>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        StoryData: {},
        CurrentIndex: 0,
        childAudioArray: [], // 播放音频的数组
      }
    },
    mounted() {
      this.StoryData = uni.getStorageSync('Story')
      this.childAudioArray = this.StoryData.childAudio
      console.log('childAudioArray', this.childAudioArray)
      this.open()
    },
    methods: {
      open() {
        this.$refs.isMusicpopup.open('bottom')
      },
      close() {
        this.$refs.isMusicpopup.close()
      },
      onCurrentNumber(index) {
        this.CurrentIndex = index
      }
    }
  }
</script>

<style lang="less" scoped>
  .container_box {
    overflow-y: auto;
    border: 1rpx solid #000;
  }

  .content_list {
    background-color: #fff;

  }

  .scroll_view_style {
    height: 450px;

  }

  .title_up {
    display: flex;
    align-items: center;
    flex-direction: row;
    padding: 20px;
  }

  .title_up_item {
    font-size: 16px;
    color: #999;
    margin-right: 20px;
  }

  .title_up_item_active {
    font-weight: bold;
    color: #333;
  }

  .audio_box {
    padding: 20px;
    font-size: 14px;
    overflow-y: auto;
    /* 添加滚动条 */
  }
</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值