Vux: tabbar不能固定在底部

Created on 21 Jun 2016  ·  21Comments  ·  Source: airyland/vux

Version

"vux": "^0.1.1-rc3"

Android or iOS, which browser?

Chrome, iOS, 微信web开发者工具

Your Codes

<div>
  <cell title="..." value="..."></cell> 
  ...(*20)...
  <tabbar>...</tabbar>
</div>

当cell较多超过一屏时, tabbar会随页面一起向上滚动, 不会固定在底部

componentabbar demo needed doc needed

Most helpful comment

如果tabbar是在模块内页,采用上面方法还是会使tabbar随着页面滚动,采用

.weui_tabbar {
  position: fixed;
}

可解决

All 21 comments

参考WeUI的做法,设置 html,body及上级div为height:100%

不是bug
"貌似没有效果"最好给个貌似没效果的demo

就是用的demo里面的Tabbar.vue,上面加了一段Panel.vue里面的代码
然后还有个问题,weui_tab_bd没有相应的组件吗?

html,body设为100%是否有做? 没有的组件直接根据WeUI文档写html标签即可。

html,body 包括上级的div都加了
qq 20160623110247

@aplusgain 截图只看到div html,body呢?

我也尝试过 html,body和上级的div都加了height:100%, 并没有效果, 还在尝试其他的修改

看下WeUI的demo呢

https://weui.io/#/tabbar

对于上一级需要设置position为relative

<div class="weui_tab">
    <div class="weui_tab_bd">
    </div>
    <TABBAR>
</div>

嗯,这种方式可以,谢谢啦。。

<div class=h100>
  <group>
    <cell></cell>
  </group>
  <div class="weui_tab">
    <div class="weui_tab_bd">
    </div>
    <TABBAR>
  </div>
</div>

我也试了这种方式, 但是tabbar是跟在页面后面, 而不是固定在底部了

你把group那段放在weui_tab_bd里面就可以了

原来是这样, 确实解决了, 谢谢
最终大概是下面这样

<body>
  <div id=app, class=h100>
    <div class="weui_tab">
      <div class="weui_tab_bd">
        <group>
          <cell></cell>
          ...
          <cell></cell>
        </group>
      </div>
      <TABBAR>
    </div>
  </div>
</body>

如果tabbar是在模块内页,采用上面方法还是会使tabbar随着页面滚动,采用

.weui_tabbar {
  position: fixed;
}

可解决

如果用的 是 tabbar 组件可以考虑用

  .weui-tabbar {
    position: fixed !important;
  }

注意是- 不是_

@aristotll 2.x 版改了?我当时的还是 1.x 版。

@mougua 可能吧 我参考你的 发现不行, 改了下 发下造福后人

建议大家好好歇歇静态布局,练练css吧。这个东西没有捷径那。

写css,
style{
position:fixed;
boottom:0;
}

.weui-tabbar{
position: fixed !important;
top: 0;
left: 0;
bottom: auto !important;
}
这样是可以的、

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lkangd picture lkangd  ·  5Comments

GloriaCHL picture GloriaCHL  ·  4Comments

chengjs picture chengjs  ·  4Comments

wonghoman picture wonghoman  ·  4Comments

skyshirt picture skyshirt  ·  4Comments