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

2 lines
12 KiB
JavaScript

/*! For license information please see 4943.bedf6fb2.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["4943"],{94161:function(s,n,a){"use strict";a.r(n);var t=a("80681");let l=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'<h1>Steps \u6B65\u9AA4\u6761</h1>\n<div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3>\n<p>\u7528\u4E8E\u5C55\u793A\u64CD\u4F5C\u6D41\u7A0B\u7684\u5404\u4E2A\u73AF\u8282\uFF0C\u8BA9\u7528\u6237\u4E86\u89E3\u5F53\u524D\u7684\u64CD\u4F5C\u5728\u6574\u4F53\u6D41\u7A0B\u4E2D\u7684\u4F4D\u7F6E\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_">Step</span>, <span class="hljs-title class_">Steps</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_">Step</span>);\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">Steps</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<p><code>active</code> \u5C5E\u6027\u8868\u793A\u5F53\u524D\u6B65\u9AA4\u7684\u7D22\u5F15\uFF0C\u4ECE 0 \u8D77\u8BA1\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-steps</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">&quot;active&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4E70\u5BB6\u4E0B\u5355<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u5546\u5BB6\u63A5\u5355<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4E70\u5BB6\u63D0\u8D27<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4EA4\u6613\u5B8C\u6210<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n<span class="hljs-tag">&lt;/<span class="hljs-name">van-steps</span>&gt;</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">&#x27;vue&#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> active = <span class="hljs-title function_">ref</span>(<span class="hljs-number">1</span>);\n <span class="hljs-keyword">return</span> { active };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="zi-ding-yi-yang-shi" tabindex="-1">\u81EA\u5B9A\u4E49\u6837\u5F0F</h3>\n<p>\u53EF\u4EE5\u901A\u8FC7 <code>active-icon</code> \u548C <code>active-color</code> \u5C5E\u6027\u8BBE\u7F6E\u6FC0\u6D3B\u72B6\u6001\u4E0B\u7684\u56FE\u6807\u548C\u989C\u8272\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-steps</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">&quot;active&quot;</span> <span class="hljs-attr">active-icon</span>=<span class="hljs-string">&quot;success&quot;</span> <span class="hljs-attr">active-color</span>=<span class="hljs-string">&quot;#07c160&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4E70\u5BB6\u4E0B\u5355<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u5546\u5BB6\u63A5\u5355<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4E70\u5BB6\u63D0\u8D27<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\u4EA4\u6613\u5B8C\u6210<span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n<span class="hljs-tag">&lt;/<span class="hljs-name">van-steps</span>&gt;</span>\n</code></pre>\n</div><div class="van-doc-card"><h3 id="shu-xiang-bu-zou-tiao" tabindex="-1">\u7AD6\u5411\u6B65\u9AA4\u6761</h3>\n<p>\u53EF\u4EE5\u901A\u8FC7\u8BBE\u7F6E <code>direction</code> \u5C5E\u6027\u6765\u6539\u53D8\u6B65\u9AA4\u6761\u7684\u663E\u793A\u65B9\u5411\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-steps</span> <span class="hljs-attr">direction</span>=<span class="hljs-string">&quot;vertical&quot;</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">&quot;0&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>\u3010\u57CE\u5E02\u3011\u7269\u6D41\u72B6\u60011<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>2016-07-12 12:40<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>\n <span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>\u3010\u57CE\u5E02\u3011\u7269\u6D41\u72B6\u60012<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>2016-07-11 10:00<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>\n <span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-step</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>\u5FEB\u4EF6\u5DF2\u53D1\u8D27<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>2016-07-10 09:30<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>\n <span class="hljs-tag">&lt;/<span class="hljs-name">van-step</span>&gt;</span>\n<span class="hljs-tag">&lt;/<span class="hljs-name">van-steps</span>&gt;</span>\n</code></pre>\n</div><h2 id="api" tabindex="-1">API</h2>\n<div class="van-doc-card"><h3 id="steps-props" tabindex="-1">Steps 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>active</td>\n<td>\u5F53\u524D\u6B65\u9AA4\u5BF9\u5E94\u7684\u7D22\u5F15\u503C</td>\n<td><em>number | string</em></td>\n<td><code>0</code></td>\n</tr>\n<tr>\n<td>direction</td>\n<td>\u6B65\u9AA4\u6761\u65B9\u5411\uFF0C\u53EF\u9009\u503C\u4E3A <code>vertical</code></td>\n<td><em>string</em></td>\n<td><code>horizontal</code></td>\n</tr>\n<tr>\n<td>active-icon</td>\n<td>\u5F53\u524D\u6B65\u9AA4\u5BF9\u5E94\u7684\u5E95\u90E8\u56FE\u6807\uFF0C\u53EF\u9009\u503C\u89C1 <a href="#/zh-CN/icon" target="_blank">Icon \u7EC4\u4EF6</a></td>\n<td><em>string</em></td>\n<td><code>checked</code></td>\n</tr>\n<tr>\n<td>inactive-icon</td>\n<td>\u975E\u5F53\u524D\u6B65\u9AA4\u5BF9\u5E94\u7684\u5E95\u90E8\u56FE\u6807\uFF0C\u53EF\u9009\u503C\u89C1 <a href="#/zh-CN/icon" target="_blank">Icon \u7EC4\u4EF6</a></td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>finish-icon</td>\n<td>\u5DF2\u5B8C\u6210\u6B65\u9AA4\u5BF9\u5E94\u7684\u5E95\u90E8\u56FE\u6807\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E <code>inactive-icon</code>\uFF0C\u53EF\u9009\u503C\u89C1 <a href="#/zh-CN/icon" target="_blank">Icon \u7EC4\u4EF6</a></td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>active-color</td>\n<td>\u5F53\u524D\u6B65\u9AA4\u548C\u5DF2\u5B8C\u6210\u6B65\u9AA4\u7684\u989C\u8272</td>\n<td><em>string</em></td>\n<td><code>#07c160</code></td>\n</tr>\n<tr>\n<td>inactive-color</td>\n<td>\u672A\u6FC0\u6D3B\u6B65\u9AA4\u7684\u989C\u8272</td>\n<td><em>string</em></td>\n<td><code>#969799</code></td>\n</tr>\n<tr>\n<td>icon-prefix</td>\n<td>\u56FE\u6807\u7C7B\u540D\u524D\u7F00\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 <a href="#/zh-CN/icon#props" target="_blank">class-prefix \u5C5E\u6027</a></td>\n<td><em>string</em></td>\n<td><code>van-icon</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="step-slots" tabindex="-1">Step 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>\u6B65\u9AA4\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>active-icon</td>\n<td>\u81EA\u5B9A\u4E49\u6FC0\u6D3B\u72B6\u6001\u56FE\u6807</td>\n</tr>\n<tr>\n<td>inactive-icon</td>\n<td>\u81EA\u5B9A\u4E49\u672A\u6FC0\u6D3B\u72B6\u6001\u56FE\u6807</td>\n</tr>\n<tr>\n<td>finish-icon</td>\n<td>\u81EA\u5B9A\u4E49\u5DF2\u5B8C\u6210\u6B65\u9AA4\u5BF9\u5E94\u7684\u5E95\u90E8\u56FE\u6807\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E <code>inactive-icon</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="steps-events" tabindex="-1">Steps 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>click-step</td>\n<td>\u70B9\u51FB\u6B65\u9AA4\u7684\u6807\u9898\u6216\u56FE\u6807\u65F6\u89E6\u53D1</td>\n<td><em>index: number</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_">StepsProps</span>, <span class="hljs-title class_">StepsDirection</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-step-text-color</td>\n<td><em>var(--van-text-color-2)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-active-color</td>\n<td><em>var(--van-primary-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-process-text-color</td>\n<td><em>var(--van-text-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-font-size</td>\n<td><em>var(--van-font-size-md)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-line-color</td>\n<td><em>var(--van-border-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-finish-line-color</td>\n<td><em>var(--van-primary-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-finish-text-color</td>\n<td><em>var(--van-text-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-icon-size</td>\n<td><em>12px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-circle-size</td>\n<td><em>5px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-circle-color</td>\n<td><em>var(--van-gray-6)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-step-horizontal-title-font-size</td>\n<td><em>var(--van-font-size-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-steps-background</td>\n<td><em>var(--van-background-2)</em></td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div>'},null,8,l))}}}]);