mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
feat(AddressList): add new right-icon props (#11959)
This commit is contained in:
parent
803b471dbd
commit
97fa5301fb
@ -6,6 +6,7 @@ import {
|
||||
numericProp,
|
||||
makeArrayProp,
|
||||
createNamespace,
|
||||
makeStringProp,
|
||||
} from '../utils';
|
||||
|
||||
// Components
|
||||
@ -23,6 +24,7 @@ export const addressListProps = {
|
||||
disabledList: makeArrayProp<AddressListAddress>(),
|
||||
addButtonText: String,
|
||||
defaultTagText: String,
|
||||
rightIcon: makeStringProp('edit'),
|
||||
};
|
||||
|
||||
export type AddressListProps = ExtractPropTypes<typeof addressListProps>;
|
||||
@ -72,6 +74,7 @@ export default defineComponent({
|
||||
disabled={disabled}
|
||||
switchable={props.switchable}
|
||||
defaultTagText={props.defaultTagText}
|
||||
rightIcon={props.rightIcon}
|
||||
onEdit={onEdit}
|
||||
onClick={onClick}
|
||||
onSelect={onSelect}
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
createNamespace,
|
||||
makeRequiredProp,
|
||||
type Numeric,
|
||||
makeStringProp,
|
||||
} from '../utils';
|
||||
|
||||
// Components
|
||||
@ -32,6 +33,7 @@ export default defineComponent({
|
||||
disabled: Boolean,
|
||||
switchable: Boolean,
|
||||
defaultTagText: String,
|
||||
rightIcon: makeStringProp('edit'),
|
||||
},
|
||||
|
||||
emits: ['edit', 'click', 'select'],
|
||||
@ -46,7 +48,7 @@ export default defineComponent({
|
||||
|
||||
const renderRightIcon = () => (
|
||||
<Icon
|
||||
name="edit"
|
||||
name={props.rightIcon}
|
||||
class={bem('edit')}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
|
@ -90,6 +90,7 @@ export default {
|
||||
| switchable | Whether to allow switch address | _boolean_ | `true` |
|
||||
| add-button-text | Add button text | _string_ | `Add new address` |
|
||||
| default-tag-text | Default tag text | _string_ | - |
|
||||
| right-icon `v4.4.2` | Right Icon | _string_ | `edit` |
|
||||
|
||||
### Events
|
||||
|
||||
|
@ -81,15 +81,16 @@ export default {
|
||||
|
||||
### Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| ---------------- | ----------------- | ---------------------- | ---------- |
|
||||
| v-model | 当前选中地址的 id | _number \| string_ | - |
|
||||
| list | 地址列表 | _AddressListAddress[]_ | `[]` |
|
||||
| disabled-list | 不可配送地址列表 | _AddressListAddress[]_ | `[]` |
|
||||
| disabled-text | 不可配送提示文案 | _string_ | - |
|
||||
| switchable | 是否允许切换地址 | _boolean_ | `true` |
|
||||
| add-button-text | 底部按钮文字 | _string_ | `新增地址` |
|
||||
| default-tag-text | 默认地址标签文字 | _string_ | - |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | 当前选中地址的 id | _number \| string_ | - |
|
||||
| list | 地址列表 | _AddressListAddress[]_ | `[]` |
|
||||
| disabled-list | 不可配送地址列表 | _AddressListAddress[]_ | `[]` |
|
||||
| disabled-text | 不可配送提示文案 | _string_ | - |
|
||||
| switchable | 是否允许切换地址 | _boolean_ | `true` |
|
||||
| add-button-text | 底部按钮文字 | _string_ | `新增地址` |
|
||||
| default-tag-text | 默认地址标签文字 | _string_ | - |
|
||||
| right-icon `v4.4.2` | 右侧图标名称或图片链接,等同于 Icon 组件的 [name 属性](#/zh-CN/icon#props) | _string_ | `edit` |
|
||||
|
||||
### Events
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user