vant/v3/assets/README.zh-CN.b7d16c08.js
2024-04-20 08:49:23 +00:00

51 lines
12 KiB
JavaScript

import{o as s,a,y as n}from"./vue-libs.b44bc779.js";const d={class:"van-doc-markdown-body"},l=n(`<h1>SubmitBar \u63D0\u4EA4\u8BA2\u5355\u680F</h1><div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3><p>\u7528\u4E8E\u5C55\u793A\u8BA2\u5355\u91D1\u989D\u4E0E\u63D0\u4EA4\u8BA2\u5355\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">&#39;vue&#39;</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">SubmitBar</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#39;vant&#39;</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_">SubmitBar</span>);
</code></pre></div><h2 id="dai-ma-yan-shi" tabindex="-1">\u4EE3\u7801\u6F14\u793A</h2><div class="van-doc-card"><h3 id="ji-chu-yong-fa" tabindex="-1">\u57FA\u7840\u7528\u6CD5</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span> <span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span> <span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span> @<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span> /&gt;</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">&#39;vant&#39;</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_">onSubmit</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&#39;\u70B9\u51FB\u6309\u94AE&#39;</span>);
<span class="hljs-keyword">return</span> {
onSubmit,
};
},
};
</code></pre></div><div class="van-doc-card"><h3 id="jin-yong-zhuang-tai" tabindex="-1">\u7981\u7528\u72B6\u6001</h3><p>\u7981\u7528\u72B6\u6001\u4E0B\u4E0D\u4F1A\u89E6\u53D1 <code>submit</code> \u4E8B\u4EF6\u3002</p><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span>
<span class="hljs-attr">disabled</span>
<span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span>
<span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span>
<span class="hljs-attr">tip</span>=<span class="hljs-string">&quot;\u4F60\u7684\u6536\u8D27\u5730\u5740\u4E0D\u652F\u6301\u914D\u9001&quot;</span>
<span class="hljs-attr">tip-icon</span>=<span class="hljs-string">&quot;info-o&quot;</span>
@<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span>
/&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="jia-zai-zhuang-tai" tabindex="-1">\u52A0\u8F7D\u72B6\u6001</h3><p>\u52A0\u8F7D\u72B6\u6001\u4E0B\u4E0D\u4F1A\u89E6\u53D1 <code>submit</code> \u4E8B\u4EF6\u3002</p><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span>
<span class="hljs-attr">loading</span>
<span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span>
<span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span>
@<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span>
/&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="gao-ji-yong-fa" tabindex="-1">\u9AD8\u7EA7\u7528\u6CD5</h3><p>\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u81EA\u5B9A\u4E49\u5185\u5BB9\u3002</p><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span> <span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span> <span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span> @<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-checkbox</span> <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;checked&quot;</span>&gt;</span>\u5168\u9009<span class="hljs-tag">&lt;/<span class="hljs-name">van-checkbox</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">template</span> #<span class="hljs-attr">tip</span>&gt;</span>
\u4F60\u7684\u6536\u8D27\u5730\u5740\u4E0D\u652F\u6301\u914D\u9001, <span class="hljs-tag">&lt;<span class="hljs-name">span</span> @<span class="hljs-attr">click</span>=<span class="hljs-string">&quot;onClickLink&quot;</span>&gt;</span>\u4FEE\u6539\u5730\u5740<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">template</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">van-submit-bar</span>&gt;</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">&#39;vant&#39;</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_">onSubmit</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&#39;\u70B9\u51FB\u6309\u94AE&#39;</span>);
<span class="hljs-keyword">const</span> <span class="hljs-title function_">onClickLink</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&#39;\u4FEE\u6539\u5730\u5740&#39;</span>);
<span class="hljs-keyword">return</span> {
onSubmit,
onClickLink,
};
},
};
</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>price</td><td>\u91D1\u989D\uFF08\u5355\u4F4D\u5206\uFF09</td><td><em>number</em></td><td>-</td></tr><tr><td>decimal-length</td><td>\u91D1\u989D\u5C0F\u6570\u70B9\u4F4D\u6570</td><td><em>number | string</em></td><td><code>2</code></td></tr><tr><td>label</td><td>\u91D1\u989D\u5DE6\u4FA7\u6587\u6848</td><td><em>string</em></td><td><code>\u5408\u8BA1\uFF1A</code></td></tr><tr><td>suffix-label</td><td>\u91D1\u989D\u53F3\u4FA7\u6587\u6848</td><td><em>string</em></td><td>-</td></tr><tr><td>text-align</td><td>\u91D1\u989D\u6587\u6848\u5BF9\u9F50\u65B9\u5411\uFF0C\u53EF\u9009\u503C\u4E3A <code>left</code></td><td><em>string</em></td><td><code>right</code></td></tr><tr><td>button-text</td><td>\u6309\u94AE\u6587\u5B57</td><td><em>string</em></td><td>-</td></tr><tr><td>button-type</td><td>\u6309\u94AE\u7C7B\u578B</td><td><em>string</em></td><td><code>danger</code></td></tr><tr><td>button-color</td><td>\u81EA\u5B9A\u4E49\u6309\u94AE\u989C\u8272</td><td><em>string</em></td><td>-</td></tr><tr><td>tip</td><td>\u5728\u8BA2\u5355\u680F\u4E0A\u65B9\u7684\u63D0\u793A\u6587\u6848</td><td><em>string</em></td><td>-</td></tr><tr><td>tip-icon</td><td>\u63D0\u793A\u6587\u6848\u5DE6\u4FA7\u7684\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 <a href="#/zh-CN/icon#props" target="_blank">name \u5C5E\u6027</a></td><td><em>string</em></td><td>-</td></tr><tr><td>currency</td><td>\u8D27\u5E01\u7B26\u53F7</td><td><em>string</em></td><td><code>\xA5</code></td></tr><tr><td>disabled</td><td>\u662F\u5426\u7981\u7528\u6309\u94AE</td><td><em>boolean</em></td><td><code>false</code></td></tr><tr><td>loading</td><td>\u662F\u5426\u663E\u793A\u5C06\u6309\u94AE\u663E\u793A\u4E3A\u52A0\u8F7D\u4E2D\u72B6\u6001</td><td><em>boolean</em></td><td><code>false</code></td></tr><tr><td>safe-area-inset-bottom</td><td>\u662F\u5426\u5F00\u542F<a href="#/zh-CN/advanced-usage#di-bu-an-quan-qu-gua-pei" target="_blank">\u5E95\u90E8\u5B89\u5168\u533A\u9002\u914D</a></td><td><em>boolean</em></td><td><code>true</code></td></tr><tr><td>placeholder <code>v3.5.1</code></td><td>\u662F\u5426\u5728\u6807\u7B7E\u4F4D\u7F6E\u751F\u6210\u4E00\u4E2A\u7B49\u9AD8\u7684\u5360\u4F4D\u5143\u7D20</td><td><em>boolean</em></td><td><code>false</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>submit</td><td>\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6\u56DE\u8C03</td><td>-</td></tr></tbody></table></div><div class="van-doc-card"><h3 id="slots" tabindex="-1">Slots</h3><table><thead><tr><th>\u540D\u79F0</th><th>\u8BF4\u660E</th></tr></thead><tbody><tr><td>default</td><td>\u81EA\u5B9A\u4E49\u8BA2\u5355\u680F\u5DE6\u4FA7\u5185\u5BB9</td></tr><tr><td>button</td><td>\u81EA\u5B9A\u4E49\u6309\u94AE</td></tr><tr><td>top</td><td>\u81EA\u5B9A\u4E49\u8BA2\u5355\u680F\u4E0A\u65B9\u5185\u5BB9</td></tr><tr><td>tip</td><td>\u63D0\u793A\u6587\u6848\u4E2D\u7684\u989D\u5916\u5185\u5BB9</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_">SubmitBarProps</span>, <span class="hljs-title class_">SubmitBarTextAlign</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#39;vant&#39;</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-submit-bar-height</td><td><em>50px</em></td><td>-</td></tr><tr><td>--van-submit-bar-z-index</td><td><em>100</em></td><td>-</td></tr><tr><td>--van-submit-bar-background-color</td><td><em>var(--van-background-color-light)</em></td><td>-</td></tr><tr><td>--van-submit-bar-button-width</td><td><em>110px</em></td><td>-</td></tr><tr><td>--van-submit-bar-price-color</td><td><em>var(--van-danger-color)</em></td><td>-</td></tr><tr><td>--van-submit-bar-price-font-size</td><td><em>var(--van-font-size-sm)</em></td><td>-</td></tr><tr><td>--van-submit-bar-price-integer-font-size</td><td><em>20px</em></td><td>-</td></tr><tr><td>--van-submit-bar-price-font-family</td><td><em>var(--van-price-integer-font-family)</em></td><td>-</td></tr><tr><td>--van-submit-bar-text-color</td><td><em>var(--van-text-color)</em></td><td>-</td></tr><tr><td>--van-submit-bar-text-font-size</td><td><em>var(--van-font-size-md)</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-padding</td><td><em>var(--van-padding-xs) var(--van-padding-sm)</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-font-size</td><td><em>var(--van-font-size-sm)</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-line-height</td><td><em>1.5</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-color</td><td><em>var(--van-orange-dark)</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-background-color</td><td><em>var(--van-orange-light)</em></td><td>-</td></tr><tr><td>--van-submit-bar-tip-icon-size</td><td><em>12px</em></td><td>-</td></tr><tr><td>--van-submit-bar-button-height</td><td><em>40px</em></td><td>-</td></tr><tr><td>--van-submit-bar-padding</td><td><em>0 var(--van-padding-md)</em></td><td>-</td></tr></tbody></table></div>`,15),e=[l],h={__name:"README.zh-CN",setup(p,{expose:t}){return t({frontmatter:{}}),(c,i)=>(s(),a("div",d,e))}};export{h as default};