/*! For license information please see 4670.5aa62a6c.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["4670"],{64701:function(t,n,s){"use strict";s.r(n);var d=s("80681");let a=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,d.wg)(),(0,d.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u5730\u5740\u7F16\u8F91\u7EC4\u4EF6\uFF0C\u7528\u4E8E\u65B0\u5EFA\u3001\u66F4\u65B0\u3001\u5220\u9664\u5730\u5740\u4FE1\u606F\u3002
\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
\nimport { createApp } from 'vue';\nimport { AddressEdit } from 'vant';\n\nconst app = createApp();\napp.use(AddressEdit);\n
\n<van-address-edit\n :area-list="areaList"\n show-delete\n show-set-default\n show-search-result\n :search-result="searchResult"\n :area-columns-placeholder="['\u8BF7\u9009\u62E9', '\u8BF7\u9009\u62E9', '\u8BF7\u9009\u62E9']"\n @save="onSave"\n @delete="onDelete"\n @change-detail="onChangeDetail"\n/>\n
\nimport { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const searchResult = ref([]);\n\n const onSave = () => showToast('save');\n const onDelete = () => showToast('delete');\n const onChangeDetail = (val) => {\n if (val) {\n searchResult.value = [\n {\n name: '\u9EC4\u9F99\u4E07\u79D1\u4E2D\u5FC3',\n address: '\u676D\u5DDE\u5E02\u897F\u6E56\u533A',\n },\n ];\n } else {\n searchResult.value = [];\n }\n };\n\n return {\n onSave,\n onDelete,\n areaList,\n searchResult,\n onChangeDetail,\n };\n },\n};\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
area-list | \n\u5730\u533A\u5217\u8868 | \nobject | \n- | \n
area-columns-placeholder | \n\u5730\u533A\u9009\u62E9\u5217\u5360\u4F4D\u63D0\u793A\u6587\u5B57 | \nstring[] | \n[] | \n
area-placeholder | \n\u5730\u533A\u8F93\u5165\u6846\u5360\u4F4D\u63D0\u793A\u6587\u5B57 | \nstring | \n\u9009\u62E9\u7701 / \u5E02 / \u533A | \n
address-info | \n\u5730\u5740\u4FE1\u606F\u521D\u59CB\u503C | \nAddressEditInfo | \n{} | \n
search-result | \n\u8BE6\u7EC6\u5730\u5740\u641C\u7D22\u7ED3\u679C | \nAddressEditSearchItem[] | \n[] | \n
show-delete | \n\u662F\u5426\u663E\u793A\u5220\u9664\u6309\u94AE | \nboolean | \nfalse | \n
show-set-default | \n\u662F\u5426\u663E\u793A\u9ED8\u8BA4\u5730\u5740\u680F | \nboolean | \nfalse | \n
show-search-result | \n\u662F\u5426\u663E\u793A\u641C\u7D22\u7ED3\u679C | \nboolean | \nfalse | \n
show-area | \n\u662F\u5426\u663E\u793A\u5730\u533A | \nboolean | \ntrue | \n
show-detail | \n\u662F\u5426\u663E\u793A\u8BE6\u7EC6\u5730\u5740 | \nboolean | \ntrue | \n
disable-area | \n\u662F\u5426\u7981\u7528\u5730\u533A\u9009\u62E9 | \nboolean | \nfalse | \n
save-button-text | \n\u4FDD\u5B58\u6309\u94AE\u6587\u5B57 | \nstring | \n\u4FDD\u5B58 | \n
delete-button-text | \n\u5220\u9664\u6309\u94AE\u6587\u5B57 | \nstring | \n\u5220\u9664 | \n
detail-rows | \n\u8BE6\u7EC6\u5730\u5740\u8F93\u5165\u6846\u884C\u6570 | \nnumber | string | \n1 | \n
detail-maxlength | \n\u8BE6\u7EC6\u5730\u5740\u6700\u5927\u957F\u5EA6 | \nnumber | string | \n200 | \n
is-saving | \n\u662F\u5426\u663E\u793A\u4FDD\u5B58\u6309\u94AE\u52A0\u8F7D\u52A8\u753B | \nboolean | \nfalse | \n
is-deleting | \n\u662F\u5426\u663E\u793A\u5220\u9664\u6309\u94AE\u52A0\u8F7D\u52A8\u753B | \nboolean | \nfalse | \n
tel-validator | \n\u624B\u673A\u53F7\u683C\u5F0F\u6821\u9A8C\u51FD\u6570 | \n(val: string) => boolean | \n- | \n
tel-maxlength | \n\u624B\u673A\u53F7\u6700\u5927\u957F\u5EA6 | \nnumber | string | \n- | \n
validator | \n\u81EA\u5B9A\u4E49\u6821\u9A8C\u51FD\u6570 | \n(key: string, val: string) => string | \n- | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
save | \n\u70B9\u51FB\u4FDD\u5B58\u6309\u94AE\u65F6\u89E6\u53D1 | \ninfo: AddressEditInfo | \n
focus | \n\u8F93\u5165\u6846\u805A\u7126\u65F6\u89E6\u53D1 | \nkey: string | \n
change v4.7.0 | \n\u4EC5 name \u548C tel \u8F93\u5165\u6846\u503C\u6539\u53D8\u89E6\u53D1 | \n{key: string, value: string} | \n
delete | \n\u786E\u8BA4\u5220\u9664\u5730\u5740\u65F6\u89E6\u53D1 | \ninfo: AddressEditInfo | \n
select-search | \n\u9009\u4E2D\u641C\u7D22\u7ED3\u679C\u65F6\u89E6\u53D1 | \nvalue: string | \n
click-area | \n\u70B9\u51FB\u6536\u4EF6\u5730\u533A\u65F6\u89E6\u53D1 | \n- | \n
change-area | \n\u4FEE\u6539\u6536\u4EF6\u5730\u533A\u65F6\u89E6\u53D1 | \nselectedOptions: PickerOption[] | \n
change-detail | \n\u4FEE\u6539\u8BE6\u7EC6\u5730\u5740\u65F6\u89E6\u53D1 | \nvalue: string | \n
change-default | \n\u5207\u6362\u662F\u5426\u4F7F\u7528\u9ED8\u8BA4\u5730\u5740\u65F6\u89E6\u53D1 | \nchecked: boolean | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u5728\u90AE\u653F\u7F16\u7801\u4E0B\u65B9\u63D2\u5165\u5185\u5BB9 | \n
\u901A\u8FC7 ref \u53EF\u4EE5\u83B7\u53D6\u5230 AddressEdit \u5B9E\u4F8B\u5E76\u8C03\u7528\u5B9E\u4F8B\u65B9\u6CD5\uFF0C\u8BE6\u89C1\u7EC4\u4EF6\u5B9E\u4F8B\u65B9\u6CD5\u3002
\n\u65B9\u6CD5\u540D | \n\u8BF4\u660E | \n\u53C2\u6570 | \n\u8FD4\u56DE\u503C | \n
---|---|---|---|
setAddressDetail | \n\u8BBE\u7F6E\u8BE6\u7EC6\u5730\u5740 | \naddressDetail: string | \n- | \n
setAreaCode | \n\u8BBE\u7F6E\u5730\u533A\u7F16\u53F7 | \ncode: string | \n- | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type {\n AddressEditInfo,\n AddressEditProps,\n AddressEditInstance,\n AddressEditSearchItem,\n} from 'vant';\n
\nAddressEditInstance
\u662F\u7EC4\u4EF6\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u7528\u6CD5\u5982\u4E0B\uFF1A
import { ref } from 'vue';\nimport type { AddressEditInstance } from 'vant';\n\nconst addressEditRef = ref<AddressEditInstance>();\n\naddressEditRef.value?.setAddressDetail('');\n
\n\u6CE8\u610F\uFF1AAddressEditInfo
\u4EC5\u4F5C\u4E3A\u521D\u59CB\u503C\u4F20\u5165\uFF0C\u8868\u5355\u6700\u7EC8\u5185\u5BB9\u53EF\u4EE5\u5728 save \u4E8B\u4EF6\u4E2D\u83B7\u53D6\u3002
key | \n\u8BF4\u660E | \n\u7C7B\u578B | \n
---|---|---|
name | \n\u59D3\u540D | \nstring | \n
tel | \n\u624B\u673A\u53F7 | \nstring | \n
province | \n\u7701\u4EFD | \nstring | \n
city | \n\u57CE\u5E02 | \nstring | \n
county | \n\u533A\u53BF | \nstring | \n
addressDetail | \n\u8BE6\u7EC6\u5730\u5740 | \nstring | \n
areaCode | \n\u5730\u533A\u7F16\u7801\uFF0C\u901A\u8FC7 \u7701\u5E02\u533A\u9009\u62E9 \u83B7\u53D6\uFF08\u5FC5\u586B\uFF09 | \nstring | \n
isDefault | \n\u662F\u5426\u4E3A\u9ED8\u8BA4\u5730\u5740 | \nboolean | \n
key | \n\u8BF4\u660E | \n\u7C7B\u578B | \n
---|---|---|
name | \n\u5730\u540D | \nstring | \n
address | \n\u8BE6\u7EC6\u5730\u5740 | \nstring | \n
\u8BF7\u53C2\u8003 Area \u7701\u5E02\u533A\u9009\u62E9 \u7EC4\u4EF6\u3002
\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\u540D\u79F0 | \n\u9ED8\u8BA4\u503C | \n\u63CF\u8FF0 | \n
---|---|---|
--van-address-edit-padding | \nvar(--van-padding-sm) | \n- | \n
--van-address-edit-buttons-padding | \nvar(--van-padding-xl) var(--van-padding-base) | \n- | \n
--van-address-edit-button-margin-bottom | \nvar(--van-padding-sm) | \n- | \n
--van-address-edit-button-font-size | \nvar(--van-font-size-lg) | \n- | \n