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

24 lines
6.5 KiB
JavaScript

import{o as a,a as t,y as n}from"./vue-libs.b44bc779.js";const e={class:"van-doc-markdown-body"},l=n(`<h1>Loading</h1><div class="van-doc-card"><h3 id="intro" tabindex="-1">Intro</h3><p>Used to indicate the transition state during loading.</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">&#39;vue&#39;</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">Loading</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_">Loading</span>);
</code></pre></div><h2 id="usage" tabindex="-1">Usage</h2><div class="van-doc-card"><h3 id="type" tabindex="-1">Type</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;spinner&quot;</span> /&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="color" tabindex="-1">Color</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">color</span>=<span class="hljs-string">&quot;#1989fa&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;spinner&quot;</span> <span class="hljs-attr">color</span>=<span class="hljs-string">&quot;#1989fa&quot;</span> /&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="size" tabindex="-1">Size</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">size</span>=<span class="hljs-string">&quot;24&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;spinner&quot;</span> <span class="hljs-attr">size</span>=<span class="hljs-string">&quot;24px&quot;</span> /&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="text" tabindex="-1">Text</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">size</span>=<span class="hljs-string">&quot;24px&quot;</span>&gt;</span>Loading...<span class="hljs-tag">&lt;/<span class="hljs-name">van-loading</span>&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="vertical" tabindex="-1">Vertical</h3><pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">size</span>=<span class="hljs-string">&quot;24px&quot;</span> <span class="hljs-attr">vertical</span>&gt;</span>Loading...<span class="hljs-tag">&lt;/<span class="hljs-name">van-loading</span>&gt;</span>
</code></pre></div><div class="van-doc-card"><h3 id="text-color" tabindex="-1">Text Color</h3><p>use <code>color</code> or <code>text-color</code> to change text color.</p><pre><code class="language-html"><span class="hljs-comment">&lt;!-- the color of text and icon will be changed --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">color</span>=<span class="hljs-string">&quot;#0094ff&quot;</span> /&gt;</span>
<span class="hljs-comment">&lt;!-- only change text color --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">van-loading</span> <span class="hljs-attr">text-color</span>=<span class="hljs-string">&quot;#0094ff&quot;</span> /&gt;</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>Attribute</th><th>Description</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td>color</td><td>Loading color</td><td><em>string</em></td><td><code>#c9c9c9</code></td></tr><tr><td>type</td><td>Can be set to <code>spinner</code></td><td><em>string</em></td><td><code>circular</code></td></tr><tr><td>size</td><td>Icon size</td><td><em>number | string</em></td><td><code>30px</code></td></tr><tr><td>text-size</td><td>Text font size</td><td><em>number | string</em></td><td><code>14px</code></td></tr><tr><td>text-color</td><td>Text color</td><td><em>string</em></td><td><code>#c9c9c9</code></td></tr><tr><td>vertical</td><td>Whether to arrange icons and text content vertically</td><td><em>boolean</em></td><td><code>false</code></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="slots" tabindex="-1">Slots</h3><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>default</td><td>Loading text</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_">LoadingType</span>, <span class="hljs-title class_">LoadingProps</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#39;vant&#39;</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-loading-text-color</td><td><em>var(--van-text-color-2)</em></td><td>-</td></tr><tr><td>--van-loading-text-font-size</td><td><em>var(--van-font-size-md)</em></td><td>-</td></tr><tr><td>--van-loading-spinner-color</td><td><em>var(--van-gray-5)</em></td><td>-</td></tr><tr><td>--van-loading-spinner-size</td><td><em>30px</em></td><td>-</td></tr><tr><td>--van-loading-spinner-animation-duration</td><td><em>0.8s</em></td><td>-</td></tr></tbody></table></div>`,16),d=[l],h={__name:"README",setup(o,{expose:s}){return s({frontmatter:{}}),(p,r)=>(a(),t("div",e,d))}};export{h as default};