mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
43 lines
9.8 KiB
JavaScript
43 lines
9.8 KiB
JavaScript
import{o as t,a,y as n}from"./vue-libs.b44bc779.js";const e={class:"van-doc-markdown-body"},l=n(`<h1>Steps</h1><div class="van-doc-card"><h3 id="intro" tabindex="-1">Intro</h3><p>Used to show the various parts of the action flow and let the user know where the current action fits into the overall flow.</p></div><div class="van-doc-card"><h3 id="install" tabindex="-1">Install</h3><p>Register component globally via <code>app.use</code>, refer to <a href="#/en-US/advanced-usage#zu-jian-zhu-ce" target="_blank">Component Registration</a> for more registration ways.</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_">Step</span>, <span class="hljs-title class_">Steps</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_">Step</span>);
|
|
app.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">Steps</span>);
|
|
</code></pre></div><h2 id="usage" tabindex="-1">Usage</h2><div class="van-doc-card"><h3 id="basic-usage" tabindex="-1">Basic Usage</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-steps</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">"active"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step1<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step2<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step3<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step4<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-steps</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">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> active = <span class="hljs-title function_">ref</span>(<span class="hljs-number">1</span>);
|
|
<span class="hljs-keyword">return</span> { active };
|
|
},
|
|
};
|
|
</code></pre></div><div class="van-doc-card"><h3 id="custom-style" tabindex="-1">Custom Style</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-steps</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">"active"</span> <span class="hljs-attr">active-icon</span>=<span class="hljs-string">"success"</span> <span class="hljs-attr">active-color</span>=<span class="hljs-string">"#38f"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step1<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step2<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step3<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>Step4<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-steps</span>></span>
|
|
</code></pre></div><div class="van-doc-card"><h3 id="vertical-steps" tabindex="-1">Vertical Steps</h3><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-steps</span> <span class="hljs-attr">direction</span>=<span class="hljs-string">"vertical"</span> <span class="hljs-attr">:active</span>=<span class="hljs-string">"0"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">h3</span>></span>\u3010City\u3011Status1<span class="hljs-tag"></<span class="hljs-name">h3</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>2016-07-12 12:40<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">h3</span>></span>\u3010City\u3011Status2<span class="hljs-tag"></<span class="hljs-name">h3</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>2016-07-11 10:00<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">h3</span>></span>\u3010City\u3011Status3<span class="hljs-tag"></<span class="hljs-name">h3</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>2016-07-10 09:30<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-step</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-steps</span>></span>
|
|
</code></pre></div><h2 id="api" tabindex="-1">API</h2><div class="van-doc-card"><h3 id="steps-props" tabindex="-1">Steps Props</h3><table><thead><tr><th>Attribute</th><th>Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>active</td><td>Active step</td><td><em>number | string</em></td><td><code>0</code></td></tr><tr><td>direction</td><td>Can be set to <code>vertical</code></td><td><em>string</em></td><td><code>horizontal</code></td></tr><tr><td>active-color</td><td>Active step color</td><td><em>string</em></td><td><code>#07c160</code></td></tr><tr><td>inactive-color</td><td>Inactive step color</td><td><em>string</em></td><td><code>#969799</code></td></tr><tr><td>active-icon</td><td>Active icon name</td><td><em>string</em></td><td><code>checked</code></td></tr><tr><td>inactive-icon</td><td>Inactive icon name</td><td><em>string</em></td><td>-</td></tr><tr><td>finish-icon <code>v3.0.7</code></td><td>Finish icon name</td><td><em>string</em></td><td>-</td></tr><tr><td>icon-prefix <code>v3.0.15</code></td><td>Icon className prefix</td><td><em>string</em></td><td><code>van-icon</code></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="step-slots" tabindex="-1">Step Slots</h3><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>default</td><td>Step content</td></tr><tr><td>active-icon</td><td>Custom active icon</td></tr><tr><td>inactive-icon</td><td>Custom inactive icon</td></tr><tr><td>finish-icon <code>v3.0.7</code></td><td>Custom finish icon</td></tr></tbody></table></div><div class="van-doc-card"><h3 id="steps-events" tabindex="-1">Steps Events</h3><table><thead><tr><th>Event</th><th>Description</th><th>Arguments</th></tr></thead><tbody><tr><td>click-step</td><td>Emitted when a step's title or icon is clicked</td><td><em>index: number</em></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="types" tabindex="-1">Types</h3><p>The component exports the following type definitions:</p><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">'vant'</span>;
|
|
</code></pre></div><h2 id="theming" tabindex="-1">Theming</h2><div class="van-doc-card"><h3 id="css-variables" tabindex="-1">CSS Variables</h3><p>The component provides the following CSS variables, which can be used to customize styles. Please refer to <a href="#/en-US/config-provider" target="_blank">ConfigProvider component</a>.</p><table><thead><tr><th>Name</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td>--van-step-text-color</td><td><em>var(--van-text-color-2)</em></td><td>-</td></tr><tr><td>--van-step-active-color</td><td><em>var(--van-success-color)</em></td><td>-</td></tr><tr><td>--van-step-process-text-color</td><td><em>var(--van-text-color)</em></td><td>-</td></tr><tr><td>--van-step-font-size</td><td><em>var(--van-font-size-md)</em></td><td>-</td></tr><tr><td>--van-step-line-color</td><td><em>var(--van-border-color)</em></td><td>-</td></tr><tr><td>--van-step-finish-line-color</td><td><em>var(--van-success-color)</em></td><td>-</td></tr><tr><td>--van-step-finish-text-color</td><td><em>var(--van-text-color)</em></td><td>-</td></tr><tr><td>--van-step-icon-size</td><td><em>12px</em></td><td>-</td></tr><tr><td>--van-step-circle-size</td><td><em>5px</em></td><td>-</td></tr><tr><td>--van-step-circle-color</td><td><em>var(--van-gray-6)</em></td><td>-</td></tr><tr><td>--van-step-horizontal-title-font-size</td><td><em>var(--van-font-size-sm)</em></td><td>-</td></tr><tr><td>--van-steps-background-color</td><td><em>var(--van-background-color-light)</em></td><td>-</td></tr></tbody></table></div>`,14),p=[l],h={__name:"README",setup(c,{expose:s}){return s({frontmatter:{}}),(o,r)=>(t(),a("div",e,p))}};export{h as default};
|