/*! For license information please see 1113.2bada046.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["1113"],{4721:function(n,s,t){"use strict";t.r(s);var a=t("80681");let d=["innerHTML"];s.default={setup:()=>({html:""}),render:()=>((0,a.wg)(),(0,a.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u5C55\u793A\u8054\u7CFB\u4EBA\u5217\u8868\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 { ContactList } from 'vant';\n\nconst app = createApp();\napp.use(ContactList);\n
\n<van-contact-list\n v-model="chosenContactId"\n :list="list"\n default-tag-text="\u9ED8\u8BA4"\n @add="onAdd"\n @edit="onEdit"\n @select="onSelect"\n/>\n
\nimport { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const chosenContactId = ref('1');\n const list = ref([\n {\n id: '1',\n name: '\u5F20\u4E09',\n tel: '13000000000',\n isDefault: true,\n },\n {\n id: '2',\n name: '\u674E\u56DB',\n tel: '1310000000',\n },\n ]);\n\n const onAdd = () => showToast('\u65B0\u589E');\n const onEdit = (contact) => showToast('\u7F16\u8F91' + contact.id);\n const onSelect = (contact) => showToast('\u9009\u62E9' + contact.id);\n\n return {\n list,\n onAdd,\n onEdit,\n onSelect,\n chosenContactId,\n };\n },\n};\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
v-model | \n\u5F53\u524D\u9009\u4E2D\u8054\u7CFB\u4EBA\u7684 id | \nnumber | string | \n- | \n
list | \n\u8054\u7CFB\u4EBA\u5217\u8868 | \nContactListItem[] | \n[] | \n
add-text | \n\u65B0\u5EFA\u6309\u94AE\u6587\u6848 | \nstring | \n\u65B0\u5EFA\u8054\u7CFB\u4EBA | \n
default-tag-text | \n\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u6807\u7B7E\u6587\u6848 | \nstring | \n- | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
add | \n\u70B9\u51FB\u65B0\u589E\u6309\u94AE\u65F6\u89E6\u53D1 | \n- | \n
edit | \n\u70B9\u51FB\u7F16\u8F91\u6309\u94AE\u65F6\u89E6\u53D1 | \ncontact: ContactListItem\uFF0Cindex: number | \n
select | \n\u5207\u6362\u9009\u4E2D\u7684\u8054\u7CFB\u4EBA\u65F6\u89E6\u53D1 | \ncontact: ContactListItem\uFF0Cindex: number | \n
\u952E\u540D | \n\u8BF4\u660E | \n\u7C7B\u578B | \n
---|---|---|
id | \n\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u7684\u552F\u4E00\u6807\u8BC6 | \nnumber | string | \n
name | \n\u8054\u7CFB\u4EBA\u59D3\u540D | \nstring | \n
tel | \n\u8054\u7CFB\u4EBA\u624B\u673A\u53F7 | \nnumber | string | \n
isDefault | \n\u662F\u5426\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA | \nboolean | undefined | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { ContactListItem, ContactListProps } from 'vant';\n
\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-contact-list-padding | \nvar(--van-padding-sm) var(--van-padding-sm) 80px | \n- | \n
--van-contact-list-edit-icon-size | \n16px | \n- | \n
--van-contact-list-add-button-z-index | \n999 | \n- | \n
--van-contact-list-radio-color | \nvar(--van-primary-color) | \n- | \n
--van-contact-list-item-padding | \nvar(--van-padding-md) | \n- | \n