feat(Tabbar): enable safe-area-inset-bottom by default when fixed (#5968)

This commit is contained in:
neverland
2020-03-31 22:16:13 +08:00
committed by GitHub
parent e929f96e04
commit afc3164364
13 changed files with 52 additions and 42 deletions
+15 -2
View File
@@ -12,7 +12,6 @@ export default createComponent({
zIndex: [Number, String],
activeColor: String,
inactiveColor: String,
safeAreaInsetBottom: Boolean,
value: {
type: [Number, String],
default: 0,
@@ -25,6 +24,20 @@ export default createComponent({
type: Boolean,
default: true,
},
safeAreaInsetBottom: {
type: Boolean,
default: null,
},
},
computed: {
fit() {
if (this.safeAreaInsetBottom !== null) {
return this.safeAreaInsetBottom;
}
// enable safe-area-inset-bottom by default when fixed
return this.fixed;
},
},
watch: {
@@ -54,8 +67,8 @@ export default createComponent({
class={[
{ [BORDER_TOP_BOTTOM]: this.border },
bem({
unfit: !this.fit,
fixed: this.fixed,
'safe-area-inset-bottom': this.safeAreaInsetBottom,
}),
]}
>