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

ContactEdit \u8054\u7CFB\u4EBA\u7F16\u8F91

\n

\u4ECB\u7ECD

\n

\u7F16\u8F91\u5E76\u4FDD\u5B58\u8054\u7CFB\u4EBA\u4FE1\u606F\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 { ContactEdit } from 'vant';\n\nconst app = createApp();\napp.use(ContactEdit);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n
<van-contact-edit\n  is-edit\n  show-set-default\n  :contact-info="editingContact"\n  set-default-label="\u8BBE\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA"\n  @save="onSave"\n  @delete="onDelete"\n/>\n
\n
import { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n  setup() {\n    const editingContact = ref({\n      tel: '',\n      name: '',\n    });\n    const onSave = (contactInfo) => showToast('\u4FDD\u5B58');\n    const onDelete = (contactInfo) => showToast('\u5220\u9664');\n    return {\n      onSave,\n      onDelete,\n      editingContact,\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
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
contact-info\u8054\u7CFB\u4EBA\u4FE1\u606FContactEditInfo{}
is-edit\u662F\u5426\u4E3A\u7F16\u8F91\u8054\u7CFB\u4EBAbooleanfalse
is-saving\u662F\u5426\u663E\u793A\u4FDD\u5B58\u6309\u94AE\u52A0\u8F7D\u52A8\u753Bbooleanfalse
is-deleting\u662F\u5426\u663E\u793A\u5220\u9664\u6309\u94AE\u52A0\u8F7D\u52A8\u753Bbooleanfalse
tel-validator\u624B\u673A\u53F7\u683C\u5F0F\u6821\u9A8C\u51FD\u6570(tel: string) => boolean-
show-set-default\u662F\u5426\u663E\u793A\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u680Fbooleanfalse
set-default-label\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u680F\u6587\u6848string-
\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
\u4E8B\u4EF6\u540D\u8BF4\u660E\u56DE\u8C03\u53C2\u6570
save\u70B9\u51FB\u4FDD\u5B58\u6309\u94AE\u65F6\u89E6\u53D1content\uFF1A\u8868\u5355\u5185\u5BB9
delete\u70B9\u51FB\u5220\u9664\u6309\u94AE\u65F6\u89E6\u53D1content\uFF1A\u8868\u5355\u5185\u5BB9
change-default\u5207\u6362\u662F\u5426\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u65F6\u89E6\u53D1checked\uFF1A\u662F\u5426\u9ED8\u8BA4
\n

ContactEditInfo \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
\u952E\u540D\u8BF4\u660E\u7C7B\u578B
name\u8054\u7CFB\u4EBA\u59D3\u540Dstring
tel\u8054\u7CFB\u4EBA\u624B\u673A\u53F7string
isDefault\u662F\u5426\u9ED8\u8BA4boolean | undefined
\n

\u7C7B\u578B\u5B9A\u4E49

\n

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

\n
import type { ContactEditInfo, ContactEditProps } 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
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-contact-edit-paddingvar(--van-padding-md)-
--van-contact-edit-fields-radiusvar(--van-radius-md)-
--van-contact-edit-buttons-paddingvar(--van-padding-xl) 0-
--van-contact-edit-button-margin-bottomvar(--van-padding-sm)-
--van-contact-edit-button-font-sizevar(--van-font-size-lg)-
--van-contact-edit-field-label-width4.1em-
\n
'},null,8,d))}}}]);