Skip to content

Commit

Permalink
fix(taro-router): 修复 min-height 误写成 height
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfield550 committed Nov 7, 2019
1 parent f5b689d commit 0a98fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-router/src/router/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class Route extends Taro.Component<RouteProps, {}> {
<div
className="taro_page"
ref={this.getWrapRef}
style={{ height: '100%' }}>
style={{ minHeight: '100%' }}>
<WrappedComponent ref={this.getRef} />
</div>
)
Expand Down

3 comments on commit 0a98fd1

@myl0204
Copy link
Contributor

@myl0204 myl0204 commented on 0a98fd1 Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改动之后,tab页内容不足时,无法用height: 100%;来撑开页面了。
这里改用minHeight的原因是?

@Garfield550
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改动之后,tab页内容不足时,无法用height: 100%;来撑开页面了。
这里改用minHeight的原因是?

是为了保持之前的行为,height: 100%; 引入了其他的问题,导致页面整体异常。

https://github.com/NervJS/taro/blame/1dc346c4c8418268635e1c31428e296cd6ecd4df/packages/taro-router/src/router/route.tsx#L150

@myl0204
Copy link
Contributor

@myl0204 myl0204 commented on 0a98fd1 Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改动之后,tab页内容不足时,无法用height: 100%;来撑开页面了。
这里改用minHeight的原因是?

是为了保持之前的行为,height: 100%; 引入了其他的问题,导致页面整体异常。

https://github.com/NervJS/taro/blame/1dc346c4c8418268635e1c31428e296cd6ecd4df/packages/taro-router/src/router/route.tsx#L150

那页面内容不足时,好像只能用calc(100vh - taro-tabbar-height)来计算高度从而撑满taro-page容器?感觉不是很优雅,而且每个“内容不足”的页面都要这么干。

Please sign in to comment.