/*! For license information please see 1987.332018b2.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["1987"],{35546:function(s,n,t){"use strict";t.r(n);var d=t("80681");let a=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,d.wg)(),(0,d.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

AddressList \u5730\u5740\u5217\u8868

\n

\u4ECB\u7ECD

\n

\u5C55\u793A\u5730\u5740\u4FE1\u606F\u5217\u8868\u3002

\n

\u5F15\u5165

\n

\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002

\n
import { createApp } from 'vue';\nimport { AddressList } from 'vant';\n\nconst app = createApp();\napp.use(AddressList);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n
<van-address-list\n  v-model="chosenAddressId"\n  :list="list"\n  :disabled-list="disabledList"\n  disabled-text="\u4EE5\u4E0B\u5730\u5740\u8D85\u51FA\u914D\u9001\u8303\u56F4"\n  default-tag-text="\u9ED8\u8BA4"\n  @add="onAdd"\n  @edit="onEdit"\n/>\n
\n
import { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n  setup() {\n    const chosenAddressId = ref('1');\n    const list = [\n      {\n        id: '1',\n        name: '\u5F20\u4E09',\n        tel: '13000000000',\n        address: '\u6D59\u6C5F\u7701\u676D\u5DDE\u5E02\u897F\u6E56\u533A\u6587\u4E09\u8DEF 138 \u53F7\u4E1C\u65B9\u901A\u4FE1\u5927\u53A6 7 \u697C 501 \u5BA4',\n        isDefault: true,\n      },\n      {\n        id: '2',\n        name: '\u674E\u56DB',\n        tel: '1310000000',\n        address: '\u6D59\u6C5F\u7701\u676D\u5DDE\u5E02\u62F1\u5885\u533A\u83AB\u5E72\u5C71\u8DEF 50 \u53F7',\n      },\n    ];\n    const disabledList = [\n      {\n        id: '3',\n        name: '\u738B\u4E94',\n        tel: '1320000000',\n        address: '\u6D59\u6C5F\u7701\u676D\u5DDE\u5E02\u6EE8\u6C5F\u533A\u6C5F\u5357\u5927\u9053 15 \u53F7',\n      },\n    ];\n\n    const onAdd = () => showToast('\u65B0\u589E\u5730\u5740');\n    const onEdit = (item, index) => showToast('\u7F16\u8F91\u5730\u5740:' + index);\n\n    return {\n      list,\n      onAdd,\n      onEdit,\n      disabledList,\n      chosenAddressId,\n    };\n  },\n};\n
\n

API

\n

Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
v-model\u5F53\u524D\u9009\u4E2D\u5730\u5740\u7684 idnumber | string-
list\u5730\u5740\u5217\u8868AddressListAddress[][]
disabled-list\u4E0D\u53EF\u914D\u9001\u5730\u5740\u5217\u8868AddressListAddress[][]
disabled-text\u4E0D\u53EF\u914D\u9001\u63D0\u793A\u6587\u6848string-
switchable\u662F\u5426\u5141\u8BB8\u5207\u6362\u5730\u5740booleantrue
show-add-button\u662F\u5426\u663E\u793A\u5E95\u90E8\u6309\u94AEbooleantrue
add-button-text\u5E95\u90E8\u6309\u94AE\u6587\u5B57string\u65B0\u589E\u5730\u5740
default-tag-text\u9ED8\u8BA4\u5730\u5740\u6807\u7B7E\u6587\u5B57string-
right-icon v4.5.0\u53F3\u4FA7\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027stringedit
\n

Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u4E8B\u4EF6\u540D\u8BF4\u660E\u56DE\u8C03\u53C2\u6570
add\u70B9\u51FB\u65B0\u589E\u6309\u94AE\u65F6\u89E6\u53D1-
edit\u70B9\u51FB\u7F16\u8F91\u6309\u94AE\u65F6\u89E6\u53D1item: AddressListAddress, index: number
select\u5207\u6362\u9009\u4E2D\u7684\u5730\u5740\u65F6\u89E6\u53D1item: AddressListAddress, index: number
edit-disabled\u7F16\u8F91\u4E0D\u53EF\u914D\u9001\u7684\u5730\u5740\u65F6\u89E6\u53D1item: AddressListAddress, index: number
select-disabled\u9009\u4E2D\u4E0D\u53EF\u914D\u9001\u7684\u5730\u5740\u65F6\u89E6\u53D1item: AddressListAddress, index: number
click-item\u70B9\u51FB\u4EFB\u610F\u5730\u5740\u65F6\u89E6\u53D1item: AddressListAddress, index: number, { event }
\n

AddressListAddress \u6570\u636E\u7ED3\u6784

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u952E\u540D\u8BF4\u660E\u7C7B\u578B
id\u6BCF\u6761\u5730\u5740\u7684\u552F\u4E00\u6807\u8BC6number | string
name\u59D3\u540Dstring
tel\u624B\u673A\u53F7number | string
address\u8BE6\u7EC6\u5730\u5740string
isDefault\u662F\u5426\u4E3A\u9ED8\u8BA4\u5730\u5740boolean
\n

Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u8BF4\u660E\u53C2\u6570
default\u5728\u5217\u8868\u4E0B\u65B9\u63D2\u5165\u5185\u5BB9-
top\u5728\u9876\u90E8\u63D2\u5165\u5185\u5BB9-
item-bottom\u5728\u5217\u8868\u9879\u5E95\u90E8\u63D2\u5165\u5185\u5BB9item: AddressListAddress
tag\u81EA\u5B9A\u4E49\u5217\u8868\u9879\u6807\u7B7E\u5185\u5BB9item: AddressListAddress
\n

\u7C7B\u578B\u5B9A\u4E49

\n

\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A

\n
import type { AddressListProps, AddressListAddress } from 'vant';\n
\n

\u4E3B\u9898\u5B9A\u5236

\n

\u6837\u5F0F\u53D8\u91CF

\n

\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-address-list-paddingvar(--van-padding-sm) var(--van-padding-sm) 80px-
--van-address-list-disabled-text-colorvar(--van-text-color-2)-
--van-address-list-disabled-text-paddingvar(--van-padding-base) * 5 0 var(--van-padding-md)-
--van-address-list-disabled-text-font-sizevar(--van-font-size-md)-
--van-address-list-disabled-text-line-heightvar(--van-line-height-md)-
--van-address-list-add-button-z-index999-
--van-address-list-item-paddingvar(--van-padding-sm)-
--van-address-list-item-text-colorvar(--van-text-color)-
--van-address-list-item-disabled-text-colorvar(--van-text-color-3)-
--van-address-list-item-font-size13px-
--van-address-list-item-line-heightvar(--van-line-height-sm)-
--van-address-list-radio-colorvar(--van-primary-color)-
--van-address-list-edit-icon-size20px-
\n
'},null,8,a))}}}]);