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

2 lines
14 KiB
JavaScript

/*! For license information please see 4995.e6dfc808.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["4995"],{35173:function(n,t,s){"use strict";s.r(t);var a=s("80681");let e=["innerHTML"];t.default={setup:()=>({html:""}),render:()=>((0,a.wg)(),(0,a.iD)("div",{class:"van-doc-markdown-body",innerHTML:'<h1>Skeleton \u9AA8\u67B6\u5C4F</h1>\n<div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3>\n<p>\u7528\u4E8E\u5728\u5185\u5BB9\u52A0\u8F7D\u8FC7\u7A0B\u4E2D\u5C55\u793A\u4E00\u7EC4\u5360\u4F4D\u56FE\u5F62\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> {\n <span class="hljs-title class_">Skeleton</span>,\n <span class="hljs-title class_">SkeletonTitle</span>,\n <span class="hljs-title class_">SkeletonImage</span>,\n <span class="hljs-title class_">SkeletonAvatar</span>,\n <span class="hljs-title class_">SkeletonParagraph</span>,\n} <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_">Skeleton</span>);\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">SkeletonTitle</span>);\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">SkeletonImage</span>);\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">SkeletonAvatar</span>);\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">SkeletonParagraph</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>\u901A\u8FC7 <code>title</code> \u5C5E\u6027\u663E\u793A\u6807\u9898\u5360\u4F4D\u56FE\uFF0C\u901A\u8FC7 <code>row</code> \u5C5E\u6027\u914D\u7F6E\u5360\u4F4D\u6BB5\u843D\u884C\u6570\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton</span> <span class="hljs-attr">title</span> <span class="hljs-attr">:row</span>=<span class="hljs-string">&quot;3&quot;</span> /&gt;</span>\n</code></pre>\n</div><div class="van-doc-card"><h3 id="xian-shi-tou-xiang" tabindex="-1">\u663E\u793A\u5934\u50CF</h3>\n<p>\u901A\u8FC7 <code>avatar</code> \u5C5E\u6027\u663E\u793A\u5934\u50CF\u5360\u4F4D\u56FE\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton</span> <span class="hljs-attr">title</span> <span class="hljs-attr">avatar</span> <span class="hljs-attr">:row</span>=<span class="hljs-string">&quot;3&quot;</span> /&gt;</span>\n</code></pre>\n</div><div class="van-doc-card"><h3 id="zhan-shi-zi-zu-jian" tabindex="-1">\u5C55\u793A\u5B50\u7EC4\u4EF6</h3>\n<p>\u5C06 <code>loading</code> \u5C5E\u6027\u8BBE\u7F6E\u6210 <code>false</code> \u8868\u793A\u5185\u5BB9\u52A0\u8F7D\u5B8C\u6210\uFF0C\u6B64\u65F6\u4F1A\u9690\u85CF\u5360\u4F4D\u56FE\uFF0C\u5E76\u663E\u793A <code>Skeleton</code> \u7684\u5B50\u7EC4\u4EF6\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton</span> <span class="hljs-attr">title</span> <span class="hljs-attr">avatar</span> <span class="hljs-attr">:row</span>=<span class="hljs-string">&quot;3&quot;</span> <span class="hljs-attr">:loading</span>=<span class="hljs-string">&quot;loading&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>\u5B9E\u9645\u5185\u5BB9<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>\n<span class="hljs-tag">&lt;/<span class="hljs-name">van-skeleton</span>&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref, onMounted } <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> loading = <span class="hljs-title function_">ref</span>(<span class="hljs-literal">true</span>);\n\n <span class="hljs-title function_">onMounted</span>(<span class="hljs-function">() =&gt;</span> {\n loading.<span class="hljs-property">value</span> = <span class="hljs-literal">false</span>;\n });\n\n <span class="hljs-keyword">return</span> {\n loading,\n };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="zi-ding-yi-zhan-shi-nei-rong" tabindex="-1">\u81EA\u5B9A\u4E49\u5C55\u793A\u5185\u5BB9</h3>\n<p>\u901A\u8FC7 <code>template</code> \u63D2\u69FD\u5B8C\u6210\u81EA\u5B9A\u4E49\u5185\u5BB9\u7684\u5C55\u793A\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">template</span> #<span class="hljs-attr">template</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">:style</span>=<span class="hljs-string">&quot;{ display: &#x27;flex&#x27;, width: &#x27;100%&#x27; }&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton-image</span> /&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">:style</span>=<span class="hljs-string">&quot;{ flex: 1, marginLeft: &#x27;16px&#x27; }&quot;</span>&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton-paragraph</span> <span class="hljs-attr">row-width</span>=<span class="hljs-string">&quot;60%&quot;</span> /&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton-paragraph</span> /&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton-paragraph</span> /&gt;</span>\n <span class="hljs-tag">&lt;<span class="hljs-name">van-skeleton-paragraph</span> /&gt;</span>\n <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>\n <span class="hljs-tag">&lt;/<span class="hljs-name">div</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-skeleton</span>&gt;</span>\n</code></pre>\n</div><h2 id="api" tabindex="-1">API</h2>\n<div class="van-doc-card"><h3 id="skeleton-props" tabindex="-1">Skeleton 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>row</td>\n<td>\u6BB5\u843D\u5360\u4F4D\u56FE\u884C\u6570</td>\n<td><em>number | string</em></td>\n<td><code>0</code></td>\n</tr>\n<tr>\n<td>row-width</td>\n<td>\u6BB5\u843D\u5360\u4F4D\u56FE\u5BBD\u5EA6\uFF0C\u53EF\u4F20\u6570\u7EC4\u6765\u8BBE\u7F6E\u6BCF\u4E00\u884C\u7684\u5BBD\u5EA6</td>\n<td><em>number | string |<br>(number | string)[]</em></td>\n<td><code>100%</code></td>\n</tr>\n<tr>\n<td>title</td>\n<td>\u662F\u5426\u663E\u793A\u6807\u9898\u5360\u4F4D\u56FE</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>avatar</td>\n<td>\u662F\u5426\u663E\u793A\u5934\u50CF\u5360\u4F4D\u56FE</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\u9AA8\u67B6\u5C4F\uFF0C\u4F20 <code>false</code> \u65F6\u4F1A\u5C55\u793A\u5B50\u7EC4\u4EF6\u5185\u5BB9</td>\n<td><em>boolean</em></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>animate</td>\n<td>\u662F\u5426\u5F00\u542F\u52A8\u753B</td>\n<td><em>boolean</em></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>round</td>\n<td>\u662F\u5426\u5C06\u6807\u9898\u548C\u6BB5\u843D\u663E\u793A\u4E3A\u5706\u89D2\u98CE\u683C</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>title-width</td>\n<td>\u6807\u9898\u5360\u4F4D\u56FE\u5BBD\u5EA6</td>\n<td><em>number | string</em></td>\n<td><code>40%</code></td>\n</tr>\n<tr>\n<td>avatar-size</td>\n<td>\u5934\u50CF\u5360\u4F4D\u56FE\u5927\u5C0F</td>\n<td><em>number | string</em></td>\n<td><code>32px</code></td>\n</tr>\n<tr>\n<td>avatar-shape</td>\n<td>\u5934\u50CF\u5360\u4F4D\u56FE\u5F62\u72B6\uFF0C\u53EF\u9009\u503C\u4E3A <code>square</code></td>\n<td><em>string</em></td>\n<td><code>round</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="skeletonparagraph-props" tabindex="-1">SkeletonParagraph 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>round</td>\n<td>\u662F\u5426\u5C06\u6BB5\u843D\u663E\u793A\u4E3A\u5706\u89D2\u98CE\u683C</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>row-width</td>\n<td>\u6BB5\u843D\u5360\u4F4D\u56FE\u5BBD\u5EA6</td>\n<td><em>string</em></td>\n<td><code>100%</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="skeletontitle-props" tabindex="-1">SkeletonTitle 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>round</td>\n<td>\u662F\u5426\u5C06\u6807\u9898\u663E\u793A\u4E3A\u5706\u89D2\u98CE\u683C</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>title-width</td>\n<td>\u6807\u9898\u5360\u4F4D\u56FE\u5BBD\u5EA6</td>\n<td><em>number | string</em></td>\n<td><code>40%</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="skeletonavatar-props" tabindex="-1">SkeletonAvatar 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>avatar-size</td>\n<td>\u5934\u50CF\u5360\u4F4D\u56FE\u5927\u5C0F</td>\n<td><em>number | string</em></td>\n<td><code>32px</code></td>\n</tr>\n<tr>\n<td>avatar-shape</td>\n<td>\u5934\u50CF\u5360\u4F4D\u56FE\u5F62\u72B6\uFF0C\u53EF\u9009\u503C\u4E3A <code>square</code></td>\n<td><em>string</em></td>\n<td><code>round</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="skeletonimage-props" tabindex="-1">SkeletonImage 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>image-size</td>\n<td>\u56FE\u7247\u5360\u4F4D\u56FE\u5927\u5C0F</td>\n<td><em>number | string</em></td>\n<td><code>32px</code></td>\n</tr>\n<tr>\n<td>image-shape</td>\n<td>\u56FE\u7247\u5360\u4F4D\u56FE\u5F62\u72B6\uFF0C\u53EF\u9009\u503C\u4E3A <code>square</code></td>\n<td><em>string</em></td>\n<td><code>round</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="skeleton-slots" tabindex="-1">Skeleton 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>\u9AA8\u67B6\u5C4F\u5185\u5BB9</td>\n</tr>\n<tr>\n<td>template</td>\n<td>\u81EA\u5B9A\u4E49\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> {\n <span class="hljs-title class_">SkeletonProps</span>,\n <span class="hljs-title class_">SkeletonImageProps</span>,\n <span class="hljs-title class_">SkeletonTitleProps</span>,\n <span class="hljs-title class_">SkeletonImageShape</span>,\n <span class="hljs-title class_">SkeletonAvatarShape</span>,\n <span class="hljs-title class_">SkeletonParagraphProps</span>,\n} <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-skeleton-paragraph-height</td>\n<td><em>16px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-paragraph-background</td>\n<td><em>var(--van-active-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-paragraph-margin-top</td>\n<td><em>var(--van-padding-sm)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-title-width</td>\n<td><em>40%</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-avatar-size</td>\n<td><em>32px</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-avatar-background</td>\n<td><em>var(--van-active-color)</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-duration</td>\n<td><em>1.2s</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>--van-skeleton-image-size</td>\n<td><em>96px</em></td>\n<td></td>\n</tr>\n<tr>\n<td>--van-skeleton-image-radius</td>\n<td><em>24px</em></td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div>'},null,8,e))}}}]);