mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(AddressList): add show-add-button prop (#12090)
This commit is contained in:
parent
e42500070b
commit
44f2e30edb
@ -22,6 +22,7 @@ export const addressListProps = {
|
|||||||
switchable: truthProp,
|
switchable: truthProp,
|
||||||
disabledText: String,
|
disabledText: String,
|
||||||
disabledList: makeArrayProp<AddressListAddress>(),
|
disabledList: makeArrayProp<AddressListAddress>(),
|
||||||
|
showAddButton: truthProp,
|
||||||
addButtonText: String,
|
addButtonText: String,
|
||||||
defaultTagText: String,
|
defaultTagText: String,
|
||||||
rightIcon: makeStringProp('edit'),
|
rightIcon: makeStringProp('edit'),
|
||||||
@ -88,7 +89,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderBottom = () => (
|
const renderBottom = () =>
|
||||||
|
props.showAddButton ? (
|
||||||
<div class={[bem('bottom'), 'van-safe-area-bottom']}>
|
<div class={[bem('bottom'), 'van-safe-area-bottom']}>
|
||||||
<Button
|
<Button
|
||||||
round
|
round
|
||||||
@ -99,7 +101,7 @@ export default defineComponent({
|
|||||||
onClick={() => emit('add')}
|
onClick={() => emit('add')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
) : undefined;
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const List = renderList(props.list);
|
const List = renderList(props.list);
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
| disabled-list | Disabled address list | _Address[]_ | `[]` |
|
| disabled-list | Disabled address list | _Address[]_ | `[]` |
|
||||||
| disabled-text | Disabled text | _string_ | - |
|
| disabled-text | Disabled text | _string_ | - |
|
||||||
| switchable | Whether to allow switch address | _boolean_ | `true` |
|
| 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` |
|
| add-button-text | Add button text | _string_ | `Add new address` |
|
||||||
| default-tag-text | Default tag text | _string_ | - |
|
| default-tag-text | Default tag text | _string_ | - |
|
||||||
| right-icon `v4.5.0` | Right Icon | _string_ | `edit` |
|
| right-icon `v4.5.0` | Right Icon | _string_ | `edit` |
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
| disabled-list | 不可配送地址列表 | _AddressListAddress[]_ | `[]` |
|
| disabled-list | 不可配送地址列表 | _AddressListAddress[]_ | `[]` |
|
||||||
| disabled-text | 不可配送提示文案 | _string_ | - |
|
| disabled-text | 不可配送提示文案 | _string_ | - |
|
||||||
| switchable | 是否允许切换地址 | _boolean_ | `true` |
|
| switchable | 是否允许切换地址 | _boolean_ | `true` |
|
||||||
|
| show-add-button | 是否显示底部按钮 | _boolean_ | `true` |
|
||||||
| add-button-text | 底部按钮文字 | _string_ | `新增地址` |
|
| add-button-text | 底部按钮文字 | _string_ | `新增地址` |
|
||||||
| default-tag-text | 默认地址标签文字 | _string_ | - |
|
| default-tag-text | 默认地址标签文字 | _string_ | - |
|
||||||
| right-icon `v4.5.0` | 右侧图标名称或图片链接,等同于 Icon 组件的 [name 属性](#/zh-CN/icon#props) | _string_ | `edit` |
|
| right-icon `v4.5.0` | 右侧图标名称或图片链接,等同于 Icon 组件的 [name 属性](#/zh-CN/icon#props) | _string_ | `edit` |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user