vant/static/js/async/398.d763be94.js
2024-04-20 08:49:23 +00:00

2 lines
13 KiB
JavaScript

/*! For license information please see 398.d763be94.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["398"],{18504: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>SubmitBar \u63D0\u4EA4\u8BA2\u5355\u680F</h1>\n<div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3>\n<p>\u7528\u4E8E\u5C55\u793A\u8BA2\u5355\u91D1\u989D\u4E0E\u63D0\u4EA4\u8BA2\u5355\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">&#x27;vue&#x27;</span>;\n<span class="hljs-keyword">import</span> { <span class="hljs-title class_">SubmitBar</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</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_">SubmitBar</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">&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>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { showToast } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</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> <span class="hljs-title function_">onSubmit</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title function_">showToast</span>(<span class="hljs-string">&#x27;\u70B9\u51FB\u6309\u94AE&#x27;</span>);\n <span class="hljs-keyword">return</span> {\n onSubmit,\n };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="jin-yong-zhuang-tai" tabindex="-1">\u7981\u7528\u72B6\u6001</h3>\n<p>\u7981\u7528\u72B6\u6001\u4E0B\u4E0D\u4F1A\u89E6\u53D1 <code>submit</code> \u4E8B\u4EF6\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span>\n <span class="hljs-attr">disabled</span>\n <span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span>\n <span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span>\n <span class="hljs-attr">tip</span>=<span class="hljs-string">&quot;\u4F60\u7684\u6536\u8D27\u5730\u5740\u4E0D\u652F\u6301\u914D\u9001&quot;</span>\n <span class="hljs-attr">tip-icon</span>=<span class="hljs-string">&quot;info-o&quot;</span>\n @<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span>\n/&gt;</span>\n</code></pre>\n</div><div class="van-doc-card"><h3 id="jia-zai-zhuang-tai" tabindex="-1">\u52A0\u8F7D\u72B6\u6001</h3>\n<p>\u52A0\u8F7D\u72B6\u6001\u4E0B\u4E0D\u4F1A\u89E6\u53D1 <code>submit</code> \u4E8B\u4EF6\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-submit-bar</span>\n <span class="hljs-attr">loading</span>\n <span class="hljs-attr">:price</span>=<span class="hljs-string">&quot;3050&quot;</span>\n <span class="hljs-attr">button-text</span>=<span class="hljs-string">&quot;\u63D0\u4EA4\u8BA2\u5355&quot;</span>\n @<span class="hljs-attr">submit</span>=<span class="hljs-string">&quot;onSubmit&quot;</span>\n/&gt;</span>\n</code></pre>\n</div><div class="van-doc-card"><h3 id="gao-ji-yong-fa" tabindex="-1">\u9AD8\u7EA7\u7528\u6CD5</h3>\n<p>\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u81EA\u5B9A\u4E49\u5185\u5BB9\u3002</p>\n<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>\n <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>\n <span class="hljs-tag">&lt;<span class="hljs-name">template</span> #<span class="hljs-attr">tip</span>&gt;</span>\n \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>\n <span class="hljs-tag">&lt;/<span class="hljs-name">template</span>&gt;</span>\n<span class="hljs-tag">&lt;/<span class="hljs-name">van-submit-bar</span>&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { showToast } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</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> <span class="hljs-title function_">onSubmit</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title function_">showToast</span>(<span class="hljs-string">&#x27;\u70B9\u51FB\u6309\u94AE&#x27;</span>);\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">onClickLink</span> = (<span class="hljs-params"></span>) =&gt; <span class="hljs-title function_">showToast</span>(<span class="hljs-string">&#x27;\u4FEE\u6539\u5730\u5740&#x27;</span>);\n <span class="hljs-keyword">return</span> {\n onSubmit,\n onClickLink,\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>price</td>\n<td>\u91D1\u989D\uFF08\u5355\u4F4D\u5206\uFF09</td>\n<td><em>number</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>decimal-length</td>\n<td>\u91D1\u989D\u5C0F\u6570\u70B9\u4F4D\u6570</td>\n<td><em>number | string</em></td>\n<td><code>2</code></td>\n</tr>\n<tr>\n<td>label</td>\n<td>\u91D1\u989D\u5DE6\u4FA7\u6587\u6848</td>\n<td><em>string</em></td>\n<td><code>\u5408\u8BA1\uFF1A</code></td>\n</tr>\n<tr>\n<td>suffix-label</td>\n<td>\u91D1\u989D\u53F3\u4FA7\u6587\u6848</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>text-align</td>\n<td>\u91D1\u989D\u6587\u6848\u5BF9\u9F50\u65B9\u5411\uFF0C\u53EF\u9009\u503C\u4E3A <code>left</code></td>\n<td><em>string</em></td>\n<td><code>right</code></td>\n</tr>\n<tr>\n<td>button-text</td>\n<td>\u6309\u94AE\u6587\u5B57</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>button-type</td>\n<td>\u6309\u94AE\u7C7B\u578B</td>\n<td><em>string</em></td>\n<td><code>danger</code></td>\n</tr>\n<tr>\n<td>button-color</td>\n<td>\u81EA\u5B9A\u4E49\u6309\u94AE\u989C\u8272</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>tip</td>\n<td>\u5728\u8BA2\u5355\u680F\u4E0A\u65B9\u7684\u63D0\u793A\u6587\u6848</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>tip-icon</td>\n<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>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>currency</td>\n<td>\u8D27\u5E01\u7B26\u53F7</td>\n<td><em>string</em></td>\n<td><code>\xa5</code></td>\n</tr>\n<tr>\n<td>disabled</td>\n<td>\u662F\u5426\u7981\u7528\u6309\u94AE</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>loading</td>\n<td>\u662F\u5426\u663E\u793A\u5C06\u6309\u94AE\u663E\u793A\u4E3A\u52A0\u8F7D\u4E2D\u72B6\u6001</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>safe-area-inset-bottom</td>\n<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>\n<td><em>boolean</em></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>placeholder</td>\n<td>\u662F\u5426\u5728\u6807\u7B7E\u4F4D\u7F6E\u751F\u6210\u4E00\u4E2A\u7B49\u9AD8\u7684\u5360\u4F4D\u5143\u7D20</td>\n<td><em>boolean</em></td>\n<td><code>false</code></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>submit</td>\n<td>\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6\u56DE\u8C03</td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="slots" tabindex="-1">Slots</h3>\n<table>\n<thead>\n<tr>\n<th>\u540D\u79F0</th>\n<th>\u8BF4\u660E</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>default</td>\n<td>\u81EA\u5B9A\u4E49\u8BA2\u5355\u680F\u5DE6\u4FA7\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>button</td>\n<td>\u81EA\u5B9A\u4E49\u6309\u94AE</td>\n</tr>\n<tr>\n<td>top</td>\n<td>\u81EA\u5B9A\u4E49\u8BA2\u5355\u680F\u4E0A\u65B9\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>tip</td>\n<td>\u63D0\u793A\u6587\u6848\u4E2D\u7684\u989D\u5916\u5185\u5BB9</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_">SubmitBarProps</span>, <span class="hljs-title class_">SubmitBarTextAlign</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</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-submit-bar-height</td>\n<td><em>50px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-z-index</td>\n<td><em>100</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-background</td>\n<td><em>var(--van-background-2)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-button-width</td>\n<td><em>110px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-price-color</td>\n<td><em>var(--van-danger-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-price-font-size</td>\n<td><em>var(--van-font-size-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-price-integer-font-size</td>\n<td><em>20px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-price-font</td>\n<td><em>var(--van-price-font)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-text-color</td>\n<td><em>var(--van-text-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-text-font-size</td>\n<td><em>var(--van-font-size-md)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-padding</td>\n<td><em>var(--van-padding-xs) var(--van-padding-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-font-size</td>\n<td><em>var(--van-font-size-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-line-height</td>\n<td><em>1.5</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-color</td>\n<td><em>var(--van-orange-dark)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-background</td>\n<td><em>var(--van-orange-light)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-tip-icon-size</td>\n<td><em>12px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-button-height</td>\n<td><em>40px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-submit-bar-padding</td>\n<td><em>0 var(--van-padding-md)</em></td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div>'},null,8,d))}}}]);