diff --git a/packages/vant/src/address-list/AddressList.tsx b/packages/vant/src/address-list/AddressList.tsx index 7aba46ecc..222332cd2 100644 --- a/packages/vant/src/address-list/AddressList.tsx +++ b/packages/vant/src/address-list/AddressList.tsx @@ -22,6 +22,7 @@ export const addressListProps = { switchable: truthProp, disabledText: String, disabledList: makeArrayProp(), + showAddButton: truthProp, addButtonText: String, defaultTagText: String, rightIcon: makeStringProp('edit'), @@ -88,18 +89,19 @@ export default defineComponent({ } }; - const renderBottom = () => ( -
-
- ); + const renderBottom = () => + props.showAddButton ? ( +
+
+ ) : undefined; return () => { const List = renderList(props.list); diff --git a/packages/vant/src/address-list/README.md b/packages/vant/src/address-list/README.md index fcc4f1572..dea1f5ccf 100644 --- a/packages/vant/src/address-list/README.md +++ b/packages/vant/src/address-list/README.md @@ -88,6 +88,7 @@ export default { | disabled-list | Disabled address list | _Address[]_ | `[]` | | disabled-text | Disabled text | _string_ | - | | switchable | Whether to allow switch address | _boolean_ | `true` | +| show-add-button | Whether to show add button | _boolean_ | `true` | | add-button-text | Add button text | _string_ | `Add new address` | | default-tag-text | Default tag text | _string_ | - | | right-icon `v4.5.0` | Right Icon | _string_ | `edit` | diff --git a/packages/vant/src/address-list/README.zh-CN.md b/packages/vant/src/address-list/README.zh-CN.md index d98004882..4c1f0f666 100644 --- a/packages/vant/src/address-list/README.zh-CN.md +++ b/packages/vant/src/address-list/README.zh-CN.md @@ -88,6 +88,7 @@ export default { | disabled-list | 不可配送地址列表 | _AddressListAddress[]_ | `[]` | | disabled-text | 不可配送提示文案 | _string_ | - | | switchable | 是否允许切换地址 | _boolean_ | `true` | +| show-add-button | 是否显示底部按钮 | _boolean_ | `true` | | add-button-text | 底部按钮文字 | _string_ | `新增地址` | | default-tag-text | 默认地址标签文字 | _string_ | - | | right-icon `v4.5.0` | 右侧图标名称或图片链接,等同于 Icon 组件的 [name 属性](#/zh-CN/icon#props) | _string_ | `edit` |