Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When tab-item was too much, tab can't scroll #402

Closed
yeomanyang opened this issue Jul 19, 2016 · 2 comments
Closed

When tab-item was too much, tab can't scroll #402

yeomanyang opened this issue Jul 19, 2016 · 2 comments

Comments

@yeomanyang
Copy link

When tab-item was too much, tab can't scroll and the part of the text is blocked.I saw the tab component in vux,find that it user 'display:flex;width:100%' to layout items average.But what I want is that when tab-item was too much, tab can scroll and I can set the min width of item.
Now I can think of is use 'scroller' in tab to implementation this feature.
And I also want your advance.

Version

Android or iOS

For Android issues, please specify the brand, model and browser

Your Codes

<!--put your code here-->
<template>
      <tab-item :selected="tabItem === tab" @click="filterOrder(tab)" v-for='tab in tabs'>{{tab}}  
      </tab-item>
</template>
<script>
export default {
       data() {
            return {
                 tabs:['one','two','three','four','five','six','seven','eight','nine','ten','eleven']
            }
       }
}
</script>
### Expected behavior and actual behavior.

### Steps to reproduce the problem
@airyland
Copy link
Owner

airyland commented Jan 1, 2017

simple way:

<div style="width: 100%;overflow:scroll;-webkit-overflow-scrolling:touch;">
      <tab style="width:500px;">
        <tab-item :selected="demo1 === '分类1'" @click="demo1 = '分类1'">已发货</tab-item>
        <tab-item :selected="demo1 === '分类2'" @click="demo1 = '分类2'">未发货</tab-item>
        <tab-item :selected="demo1 === '分类3'" @click="demo1 = '分类3'">全部订单</tab-item>
        <tab-item :selected="demo1 === '分类4'" @click="demo1 = '分类4'">全部订单</tab-item>
        <tab-item :selected="demo1 === '分类5'" @click="demo1 = '分类5'">全部订单</tab-item>
      </tab>
    </div>

@cjsvaxlp
Copy link

请问下,您这tab默认宽度为100%,如果我两边有返回和退出,地下线和文本就不对齐了,如何处理
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants