mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
36 lines
7.4 KiB
JavaScript
36 lines
7.4 KiB
JavaScript
import{o as a,a as t,y as n}from"./vue-libs.b44bc779.js";const l={class:"van-doc-markdown-body"},d=n(`<h1>ContactCard \u8054\u7CFB\u4EBA\u5361\u7247</h1><div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3><p>\u4EE5\u5361\u7247\u7684\u5F62\u5F0F\u5C55\u793A\u8054\u7CFB\u4EBA\u4FE1\u606F\u3002</p></div><div class="van-doc-card"><h3 id="yin-ru" tabindex="-1">\u5F15\u5165</h3><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><pre><code class="language-js"><span class="hljs-keyword">import</span> { createApp } <span class="hljs-keyword">from</span> <span class="hljs-string">'vue'</span>;
|
|
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">ContactCard</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;
|
|
|
|
<span class="hljs-keyword">const</span> app = <span class="hljs-title function_">createApp</span>();
|
|
app.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">ContactCard</span>);
|
|
</code></pre></div><h2 id="dai-ma-yan-shi" tabindex="-1">\u4EE3\u7801\u6F14\u793A</h2><div class="van-doc-card"><h3 id="tian-jia-lian-xi-ren" tabindex="-1">\u6DFB\u52A0\u8054\u7CFB\u4EBA</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-contact-card</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"add"</span> @<span class="hljs-attr">click</span>=<span class="hljs-string">"onAdd"</span> /></span>
|
|
</code></pre><pre><code class="language-js"><span class="hljs-keyword">import</span> { <span class="hljs-title class_">Toast</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;
|
|
|
|
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
|
|
<span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {
|
|
<span class="hljs-keyword">const</span> <span class="hljs-title function_">onAdd</span> = (<span class="hljs-params"></span>) => <span class="hljs-title class_">Toast</span>(<span class="hljs-string">'\u65B0\u589E'</span>);
|
|
<span class="hljs-keyword">return</span> {
|
|
onAdd,
|
|
};
|
|
},
|
|
};
|
|
</code></pre></div><div class="van-doc-card"><h3 id="bian-ji-lian-xi-ren" tabindex="-1">\u7F16\u8F91\u8054\u7CFB\u4EBA</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-contact-card</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"edit"</span> <span class="hljs-attr">:tel</span>=<span class="hljs-string">"tel"</span> <span class="hljs-attr">:name</span>=<span class="hljs-string">"name"</span> @<span class="hljs-attr">click</span>=<span class="hljs-string">"onEdit"</span> /></span>
|
|
</code></pre><pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">'vue'</span>;
|
|
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">Toast</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;
|
|
|
|
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
|
|
<span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {
|
|
<span class="hljs-keyword">const</span> tel = <span class="hljs-title function_">ref</span>(<span class="hljs-string">'13000000000'</span>);
|
|
<span class="hljs-keyword">const</span> name = <span class="hljs-title function_">ref</span>(<span class="hljs-string">'\u5F20\u4E09'</span>);
|
|
<span class="hljs-keyword">const</span> <span class="hljs-title function_">onEdit</span> = (<span class="hljs-params"></span>) => <span class="hljs-title class_">Toast</span>(<span class="hljs-string">'edit'</span>);
|
|
<span class="hljs-keyword">return</span> {
|
|
tel,
|
|
name,
|
|
onEdit,
|
|
};
|
|
},
|
|
};
|
|
</code></pre></div><div class="van-doc-card"><h3 id="bu-ke-bian-ji" tabindex="-1">\u4E0D\u53EF\u7F16\u8F91</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-contact-card</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"edit"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"\u5F20\u4E09"</span> <span class="hljs-attr">tel</span>=<span class="hljs-string">"13000000000"</span> <span class="hljs-attr">:editable</span>=<span class="hljs-string">"false"</span> /></span>
|
|
</code></pre></div><h2 id="api" tabindex="-1">API</h2><div class="van-doc-card"><h3 id="props" tabindex="-1">Props</h3><table><thead><tr><th>\u53C2\u6570</th><th>\u8BF4\u660E</th><th>\u7C7B\u578B</th><th>\u9ED8\u8BA4\u503C</th></tr></thead><tbody><tr><td>type</td><td>\u5361\u7247\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A <code>edit</code></td><td><em>string</em></td><td><code>add</code></td></tr><tr><td>name</td><td>\u8054\u7CFB\u4EBA\u59D3\u540D</td><td><em>string</em></td><td>-</td></tr><tr><td>tel</td><td>\u8054\u7CFB\u4EBA\u624B\u673A\u53F7</td><td><em>string</em></td><td>-</td></tr><tr><td>add-text</td><td>\u6DFB\u52A0\u65F6\u7684\u6587\u6848\u63D0\u793A</td><td><em>string</em></td><td><code>\u6DFB\u52A0\u8054\u7CFB\u4EBA</code></td></tr><tr><td>editable</td><td>\u662F\u5426\u53EF\u4EE5\u7F16\u8F91\u8054\u7CFB\u4EBA</td><td><em>boolean</em></td><td><code>true</code></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="events" tabindex="-1">Events</h3><table><thead><tr><th>\u4E8B\u4EF6\u540D</th><th>\u8BF4\u660E</th><th>\u56DE\u8C03\u53C2\u6570</th></tr></thead><tbody><tr><td>click</td><td>\u70B9\u51FB\u65F6\u89E6\u53D1</td><td><em>event: MouseEvent</em></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="lei-xing-ding-yi" tabindex="-1">\u7C7B\u578B\u5B9A\u4E49</h3><p>\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A</p><pre><code class="language-ts"><span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { <span class="hljs-title class_">ContactCardType</span>, <span class="hljs-title class_">ContactCardProps</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;
|
|
</code></pre></div><h2 id="zhu-ti-ding-zhi" tabindex="-1">\u4E3B\u9898\u5B9A\u5236</h2><div class="van-doc-card"><h3 id="yang-shi-bian-liang" tabindex="-1">\u6837\u5F0F\u53D8\u91CF</h3><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><table><thead><tr><th>\u540D\u79F0</th><th>\u9ED8\u8BA4\u503C</th><th>\u63CF\u8FF0</th></tr></thead><tbody><tr><td>--van-contact-card-padding</td><td><em>var(--van-padding-md)</em></td><td>-</td></tr><tr><td>--van-contact-card-add-icon-size</td><td><em>40px</em></td><td>-</td></tr><tr><td>--van-contact-card-add-icon-color</td><td><em>var(--van-primary-color)</em></td><td>-</td></tr><tr><td>--van-contact-card-value-line-height</td><td><em>var(--van-line-height-md)</em></td><td>-</td></tr></tbody></table></div>`,13),p=[d],h={__name:"README.zh-CN",setup(e,{expose:s}){return s({frontmatter:{}}),(r,o)=>(a(),t("div",l,p))}};export{h as default};
|