mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
/*! 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:'<h1>ContactEdit \u8054\u7CFB\u4EBA\u7F16\u8F91</h1>\n<div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3>\n<p>\u7F16\u8F91\u5E76\u4FDD\u5B58\u8054\u7CFB\u4EBA\u4FE1\u606F\u3002</p>\n</div><div class="van-doc-card"><h3 id="yin-ru" tabindex="-1">\u5F15\u5165</h3>\n<p>\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003<a href="#/zh-CN/advanced-usage#zu-jian-zhu-ce" target="_blank">\u7EC4\u4EF6\u6CE8\u518C</a>\u3002</p>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { createApp } <span class="hljs-keyword">from</span> <span class="hljs-string">'vue'</span>;\n<span class="hljs-keyword">import</span> { <span class="hljs-title class_">ContactEdit</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;\n\n<span class="hljs-keyword">const</span> app = <span class="hljs-title function_">createApp</span>();\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">ContactEdit</span>);\n</code></pre>\n</div><h2 id="dai-ma-yan-shi" tabindex="-1">\u4EE3\u7801\u6F14\u793A</h2>\n<div class="van-doc-card"><h3 id="ji-chu-yong-fa" tabindex="-1">\u57FA\u7840\u7528\u6CD5</h3>\n<pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-contact-edit</span>\n <span class="hljs-attr">is-edit</span>\n <span class="hljs-attr">show-set-default</span>\n <span class="hljs-attr">:contact-info</span>=<span class="hljs-string">"editingContact"</span>\n <span class="hljs-attr">set-default-label</span>=<span class="hljs-string">"\u8BBE\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA"</span>\n @<span class="hljs-attr">save</span>=<span class="hljs-string">"onSave"</span>\n @<span class="hljs-attr">delete</span>=<span class="hljs-string">"onDelete"</span>\n/></span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">'vue'</span>;\n<span class="hljs-keyword">import</span> { showToast } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> editingContact = <span class="hljs-title function_">ref</span>({\n <span class="hljs-attr">tel</span>: <span class="hljs-string">''</span>,\n <span class="hljs-attr">name</span>: <span class="hljs-string">''</span>,\n });\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">onSave</span> = (<span class="hljs-params">contactInfo</span>) => <span class="hljs-title function_">showToast</span>(<span class="hljs-string">'\u4FDD\u5B58'</span>);\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">onDelete</span> = (<span class="hljs-params">contactInfo</span>) => <span class="hljs-title function_">showToast</span>(<span class="hljs-string">'\u5220\u9664'</span>);\n <span class="hljs-keyword">return</span> {\n onSave,\n onDelete,\n editingContact,\n };\n },\n};\n</code></pre>\n</div><h2 id="api" tabindex="-1">API</h2>\n<div class="van-doc-card"><h3 id="props" tabindex="-1">Props</h3>\n<table>\n<thead>\n<tr>\n<th>\u53C2\u6570</th>\n<th>\u8BF4\u660E</th>\n<th>\u7C7B\u578B</th>\n<th>\u9ED8\u8BA4\u503C</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>contact-info</td>\n<td>\u8054\u7CFB\u4EBA\u4FE1\u606F</td>\n<td><em>ContactEditInfo</em></td>\n<td><code>{}</code></td>\n</tr>\n<tr>\n<td>is-edit</td>\n<td>\u662F\u5426\u4E3A\u7F16\u8F91\u8054\u7CFB\u4EBA</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>is-saving</td>\n<td>\u662F\u5426\u663E\u793A\u4FDD\u5B58\u6309\u94AE\u52A0\u8F7D\u52A8\u753B</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>is-deleting</td>\n<td>\u662F\u5426\u663E\u793A\u5220\u9664\u6309\u94AE\u52A0\u8F7D\u52A8\u753B</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>tel-validator</td>\n<td>\u624B\u673A\u53F7\u683C\u5F0F\u6821\u9A8C\u51FD\u6570</td>\n<td><em>(tel: string) => boolean</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>show-set-default</td>\n<td>\u662F\u5426\u663E\u793A\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u680F</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>set-default-label</td>\n<td>\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u680F\u6587\u6848</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="events" tabindex="-1">Events</h3>\n<table>\n<thead>\n<tr>\n<th>\u4E8B\u4EF6\u540D</th>\n<th>\u8BF4\u660E</th>\n<th>\u56DE\u8C03\u53C2\u6570</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>save</td>\n<td>\u70B9\u51FB\u4FDD\u5B58\u6309\u94AE\u65F6\u89E6\u53D1</td>\n<td>content\uFF1A\u8868\u5355\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>delete</td>\n<td>\u70B9\u51FB\u5220\u9664\u6309\u94AE\u65F6\u89E6\u53D1</td>\n<td>content\uFF1A\u8868\u5355\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>change-default</td>\n<td>\u5207\u6362\u662F\u5426\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA\u65F6\u89E6\u53D1</td>\n<td>checked\uFF1A\u662F\u5426\u9ED8\u8BA4</td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="contacteditinfo-shu-ju-jie-gou" tabindex="-1">ContactEditInfo \u6570\u636E\u7ED3\u6784</h3>\n<table>\n<thead>\n<tr>\n<th>\u952E\u540D</th>\n<th>\u8BF4\u660E</th>\n<th>\u7C7B\u578B</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>\u8054\u7CFB\u4EBA\u59D3\u540D</td>\n<td><em>string</em></td>\n</tr>\n<tr>\n<td>tel</td>\n<td>\u8054\u7CFB\u4EBA\u624B\u673A\u53F7</td>\n<td><em>string</em></td>\n</tr>\n<tr>\n<td>isDefault</td>\n<td>\u662F\u5426\u9ED8\u8BA4</td>\n<td><em>boolean | undefined</em></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="lei-xing-ding-yi" tabindex="-1">\u7C7B\u578B\u5B9A\u4E49</h3>\n<p>\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A</p>\n<pre><code class="language-ts"><span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { <span class="hljs-title class_">ContactEditInfo</span>, <span class="hljs-title class_">ContactEditProps</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;\n</code></pre>\n</div><h2 id="zhu-ti-ding-zhi" tabindex="-1">\u4E3B\u9898\u5B9A\u5236</h2>\n<div class="van-doc-card"><h3 id="yang-shi-bian-liang" tabindex="-1">\u6837\u5F0F\u53D8\u91CF</h3>\n<p>\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 <a href="#/zh-CN/config-provider" target="_blank">ConfigProvider \u7EC4\u4EF6</a>\u3002</p>\n<table>\n<thead>\n<tr>\n<th>\u540D\u79F0</th>\n<th>\u9ED8\u8BA4\u503C</th>\n<th>\u63CF\u8FF0</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>--van-contact-edit-padding</td>\n<td><em>var(--van-padding-md)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-contact-edit-fields-radius</td>\n<td><em>var(--van-radius-md)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-contact-edit-buttons-padding</td>\n<td><em>var(--van-padding-xl) 0</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-contact-edit-button-margin-bottom</td>\n<td><em>var(--van-padding-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-contact-edit-button-font-size</td>\n<td><em>var(--van-font-size-lg)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-contact-edit-field-label-width</td>\n<td><em>4.1em</em></td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div>'},null,8,d))}}}]); |