mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] Tabbar: add iPhone X layout feature for fixed tabbar (#3149)
This commit is contained in:
parent
5b82d67784
commit
2b44f1a8dd
@ -69,6 +69,7 @@ export default {
|
|||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| v-model | Index of current tab | `Number` | - |
|
| v-model | Index of current tab | `Number` | - |
|
||||||
| fixed | Whether to fixed bottom | `Boolean` | `true` |
|
| fixed | Whether to fixed bottom | `Boolean` | `true` |
|
||||||
|
| safe-area-inset-bottom | Whether to iPhone X bottom safe area adaptation, to enable those features use `viewport-fit=cover` in the `viewport` meta tag | `Boolean` | `false` | 1.6.15 |
|
||||||
| z-index | Z-index | `Number` | `1` |
|
| z-index | Z-index | `Number` | `1` |
|
||||||
| active-color | Color of active tab item | `String` | `#1989fa` |
|
| active-color | Color of active tab item | `String` | `#1989fa` |
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ export default sfc({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
safeAreaInsetBottom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
zIndex: {
|
zIndex: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1
|
default: 1
|
||||||
@ -51,7 +55,13 @@ export default sfc({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{ zIndex: this.zIndex }}
|
style={{ zIndex: this.zIndex }}
|
||||||
class={['van-hairline--top-bottom', bem({ fixed: this.fixed })]}
|
class={[
|
||||||
|
'van-hairline--top-bottom',
|
||||||
|
bem({
|
||||||
|
fixed: this.fixed,
|
||||||
|
'safe-area-inset-bottom': this.safeAreaInsetBottom
|
||||||
|
})
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
{this.slots()}
|
{this.slots()}
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,4 +11,10 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--safe-area-inset-bottom {
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ export default {
|
|||||||
|------|------|------|------|------|
|
|------|------|------|------|------|
|
||||||
| v-model | 当前选中标签的索引 | `Number` | - | - |
|
| v-model | 当前选中标签的索引 | `Number` | - | - |
|
||||||
| fixed | 是否固定在底部 | `Boolean` | `true` | - |
|
| fixed | 是否固定在底部 | `Boolean` | `true` | - |
|
||||||
|
| safe-area-inset-bottom | 是否开启 iPhone X 底部安全区适配,同时需要在 `viewport` meta 标签中设置 `viewport-fit=cover` | `Boolean` | `false` | 1.6.15 |
|
||||||
| z-index | 元素 z-index | `Number` | `1` | 1.1.9 |
|
| z-index | 元素 z-index | `Number` | `1` | 1.1.9 |
|
||||||
| active-color | 选中标签的颜色 | `String` | `#1989fa` | 1.5.1 |
|
| active-color | 选中标签的颜色 | `String` | `#1989fa` | 1.5.1 |
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user