mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-10-05 16:30:00 +08:00
[improvement] extract safeAreaInsetBottom to mixin (#1052)
This commit is contained in:
parent
339df6c0e6
commit
df238651c2
@ -1,6 +1,9 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { iphonex } from '../mixins/iphonex';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
mixins: [iphonex],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
title: String,
|
title: String,
|
||||||
@ -20,10 +23,6 @@ VantComponent({
|
|||||||
closeOnClickOverlay: {
|
closeOnClickOverlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true
|
value: true
|
||||||
},
|
|
||||||
safeAreaInsetBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,12 +2,5 @@ import { VantComponent } from '../common/component';
|
|||||||
import { iphonex } from '../mixins/iphonex';
|
import { iphonex } from '../mixins/iphonex';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
mixins: [iphonex],
|
mixins: [iphonex]
|
||||||
|
|
||||||
props: {
|
|
||||||
safeAreaInsetBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
@ -19,6 +19,13 @@ function getIsIPhoneX() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const iphonex = Behavior({
|
export const iphonex = Behavior({
|
||||||
|
properties: {
|
||||||
|
safeAreaInsetBottom: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
getIsIPhoneX().then(isIPhoneX => {
|
getIsIPhoneX().then(isIPhoneX => {
|
||||||
this.set({ isIPhoneX });
|
this.set({ isIPhoneX });
|
||||||
|
@ -24,10 +24,6 @@ VantComponent({
|
|||||||
position: {
|
position: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'center'
|
value: 'center'
|
||||||
},
|
|
||||||
safeAreaInsetBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@ import { VantComponent } from '../common/component';
|
|||||||
import { iphonex } from '../mixins/iphonex';
|
import { iphonex } from '../mixins/iphonex';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
mixins: [iphonex],
|
||||||
|
|
||||||
classes: [
|
classes: [
|
||||||
'bar-class',
|
'bar-class',
|
||||||
'price-class',
|
'price-class',
|
||||||
'button-class'
|
'button-class'
|
||||||
],
|
],
|
||||||
|
|
||||||
mixins: [iphonex],
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
tip: null,
|
tip: null,
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -25,10 +25,6 @@ VantComponent({
|
|||||||
buttonType: {
|
buttonType: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'danger'
|
value: 'danger'
|
||||||
},
|
|
||||||
safeAreaInsetBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ import { VantComponent } from '../common/component';
|
|||||||
import { iphonex } from '../mixins/iphonex';
|
import { iphonex } from '../mixins/iphonex';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
mixins: [iphonex],
|
||||||
|
|
||||||
relation: {
|
relation: {
|
||||||
name: 'tabbar-item',
|
name: 'tabbar-item',
|
||||||
type: 'descendant',
|
type: 'descendant',
|
||||||
@ -19,8 +21,6 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [iphonex],
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
active: Number,
|
active: Number,
|
||||||
fixed: {
|
fixed: {
|
||||||
@ -30,10 +30,6 @@ VantComponent({
|
|||||||
zIndex: {
|
zIndex: {
|
||||||
type: Number,
|
type: Number,
|
||||||
value: 1
|
value: 1
|
||||||
},
|
|
||||||
safeAreaInsetBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user