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

alita路由多Tab和无Tab如何混用? #28

Open
gitspringcould opened this issue Oct 17, 2019 · 8 comments
Open

alita路由多Tab和无Tab如何混用? #28

gitspringcould opened this issue Oct 17, 2019 · 8 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@gitspringcould
Copy link

alita路由多Tab和无Tab如何混用,比如登录跳转到Tab页

@ykforerlang
Copy link
Member

关于tab混用,由于原生小程序不支持所以alita也支持不了。 不过这个场景,可以用如下的方式,这样login页的底部tab是不显示的

class Page extends Component {
    
    componentDidMount() {
        if (!isLogin) {
            history.push('login')
        }
    }

    render() {
        if (!isLogin) {
            return null
        }
        
        return (
            <View>...</View>
        )
    }
}

@ykforerlang ykforerlang added the question Further information is requested label Oct 17, 2019
@ykforerlang ykforerlang self-assigned this Oct 17, 2019
@gitspringcould
Copy link
Author

能给一个具体的例子吗?

@ykforerlang
Copy link
Member

/examples/HelloWorldExpo。 类似这个例子,你可以把A页看成是你的主页, C页看成是登陆页,在A页的didMount方法里面,直接调用 history.push('C'),

@gitspringcould
Copy link
Author

r
报这个错 什么原因呢

@ykforerlang
Copy link
Member

@gitspringcould 我看了下小程序跳转了, RN报错了, 正在定位。。。:smile::smile::smile:

@gitspringcould
Copy link
Author

好的,辛苦了

@ykforerlang
Copy link
Member

暂时可以把 跳转语句加到: componentDidFocus

 componentDidFocus() {
        history.push('C')
  }

@ykforerlang ykforerlang added the bug Something isn't working label Oct 17, 2019
@gitspringcould
Copy link
Author

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants