feat(GoodsAction): enable safe-area-inset-bottom by default (#5955)

This commit is contained in:
neverland 2020-03-31 06:57:22 +08:00 committed by GitHub
parent b6d23cd9d3
commit b87fd71959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View File

@ -82,7 +82,7 @@ Use `badge` prop to show badge in icon
| Attribute | Description | Type | Default | | Attribute | Description | Type | Default |
|------|------|------|------| |------|------|------|------|
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `false` | | safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `true` |
### GoodsActionIcon Props ### GoodsActionIcon Props

View File

@ -86,7 +86,7 @@ export default {
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------| |------|------|------|------|
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `false` | | safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `true` |
### GoodsActionIcon Props ### GoodsActionIcon Props

View File

@ -1,7 +1,7 @@
<template> <template>
<demo-section> <demo-section>
<demo-block :title="t('basicUsage')"> <demo-block :title="t('basicUsage')">
<van-goods-action> <van-goods-action :safe-area-inset-bottom="false">
<van-goods-action-icon <van-goods-action-icon
icon="chat-o" icon="chat-o"
:text="t('icon1')" :text="t('icon1')"
@ -26,7 +26,7 @@
</demo-block> </demo-block>
<demo-block :title="t('iconBadge')"> <demo-block :title="t('iconBadge')">
<van-goods-action> <van-goods-action :safe-area-inset-bottom="false">
<van-goods-action-icon icon="chat-o" dot :text="t('icon1')" /> <van-goods-action-icon icon="chat-o" dot :text="t('icon1')" />
<van-goods-action-icon icon="cart-o" badge="5" :text="t('icon2')" /> <van-goods-action-icon icon="cart-o" badge="5" :text="t('icon2')" />
<van-goods-action-icon icon="shop-o" badge="12" :text="t('icon3')" /> <van-goods-action-icon icon="shop-o" badge="12" :text="t('icon3')" />
@ -36,7 +36,7 @@
</demo-block> </demo-block>
<demo-block v-if="!isWeapp" :title="t('customIconColor')"> <demo-block v-if="!isWeapp" :title="t('customIconColor')">
<van-goods-action> <van-goods-action :safe-area-inset-bottom="false">
<van-goods-action-icon <van-goods-action-icon
icon="chat-o" icon="chat-o"
:text="t('icon1')" :text="t('icon1')"
@ -54,7 +54,7 @@
</demo-block> </demo-block>
<demo-block :title="t('customButtonColor')"> <demo-block :title="t('customButtonColor')">
<van-goods-action> <van-goods-action :safe-area-inset-bottom="false">
<van-goods-action-icon icon="chat-o" :text="t('icon1')" /> <van-goods-action-icon icon="chat-o" :text="t('icon1')" />
<van-goods-action-icon icon="cart-o" :text="t('icon2')" /> <van-goods-action-icon icon="cart-o" :text="t('icon2')" />
<van-goods-action-button <van-goods-action-button

View File

@ -7,7 +7,10 @@ export default createComponent({
mixins: [ParentMixin('vanGoodsAction')], mixins: [ParentMixin('vanGoodsAction')],
props: { props: {
safeAreaInsetBottom: Boolean, safeAreaInsetBottom: {
type: Boolean,
default: true,
},
}, },
render() { render() {

View File

@ -7,6 +7,7 @@
left: 0; left: 0;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: content-box;
height: @goods-action-height; height: @goods-action-height;
background-color: @goods-action-background-color; background-color: @goods-action-background-color;