tangdaohai / vue-happy-scroll

基于vue2.0实现的滚动条插件。scroll component for vue2.0

Home Page:https://tangdaohai.github.io/vue-happy-scroll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.happy-scroll-container 高度不能动态自动计算的问题

gongph opened this issue · comments

问题

Hi,@tangdaohai 遇到一个问题,先看下我的 HTML代码结构:

<div class="content-wrapper">
  <div  class="happy-scroll">
    <div class="happy-scroll-container" style="width: 320px;height: 210px;">
     <div class="happy-scroll-content">
      <div id="layers">/* 很长的内容 */</div>
      </div>
    </div>
  </div>
</div>

.content-wrapper容器的高度可以通过一个鼠标上拉改变高度。导致一个问题是,即使 .content-wrapper 高度改变了,但是 div#layers 的高度未变,其原因是 .happy-scroll-container 高度是内联固定值

需求

上拉改变容器高度时,.happy-scroll-container 高度可以自动计算高度决定是否隐藏和显示滚动条

@gongph 你好。
当前组件还暂不支持,外部容器变化后,组件跟随变化,但是你可以通过这个里面的方案处理一下:
#11

@tangdaohai 感谢,我try一下!