mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
28 lines
7.6 KiB
JavaScript
28 lines
7.6 KiB
JavaScript
import{o as t,a,y as n}from"./vue-libs.b44bc779.js";const d={class:"van-doc-markdown-body"},e=n(`<h1>Skeleton \u9AA8\u67B6\u5C4F</h1><div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3><p>\u7528\u4E8E\u5728\u5185\u5BB9\u52A0\u8F7D\u8FC7\u7A0B\u4E2D\u5C55\u793A\u4E00\u7EC4\u5360\u4F4D\u56FE\u5F62\u3002</p></div><div class="van-doc-card"><h3 id="yin-ru" tabindex="-1">\u5F15\u5165</h3><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><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_">Skeleton</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_">Skeleton</span>);
|
|
</code></pre></div><h2 id="dai-ma-yan-shi" tabindex="-1">\u4EE3\u7801\u6F14\u793A</h2><div class="van-doc-card"><h3 id="ji-chu-yong-fa" tabindex="-1">\u57FA\u7840\u7528\u6CD5</h3><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><pre><code class="language-html"><span class="hljs-tag"><<span class="hljs-name">van-skeleton</span> <span class="hljs-attr">title</span> <span class="hljs-attr">:row</span>=<span class="hljs-string">"3"</span> /></span>
|
|
</code></pre></div><div class="van-doc-card"><h3 id="xian-shi-tou-xiang" tabindex="-1">\u663E\u793A\u5934\u50CF</h3><p>\u901A\u8FC7 <code>avatar</code> \u5C5E\u6027\u663E\u793A\u5934\u50CF\u5360\u4F4D\u56FE\u3002</p><pre><code class="language-html"><span class="hljs-tag"><<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">"3"</span> /></span>
|
|
</code></pre></div><div class="van-doc-card"><h3 id="zhan-shi-zi-zu-jian" tabindex="-1">\u5C55\u793A\u5B50\u7EC4\u4EF6</h3><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><pre><code class="language-html"><span class="hljs-tag"><<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">"3"</span> <span class="hljs-attr">:loading</span>=<span class="hljs-string">"loading"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">div</span>></span>\u5B9E\u9645\u5185\u5BB9<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">van-skeleton</span>></span>
|
|
</code></pre><pre><code class="language-js"><span class="hljs-keyword">import</span> { ref, onMounted } <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> loading = <span class="hljs-title function_">ref</span>(<span class="hljs-literal">true</span>);
|
|
|
|
<span class="hljs-title function_">onMounted</span>(<span class="hljs-function">() =></span> {
|
|
loading.<span class="hljs-property">value</span> = <span class="hljs-literal">false</span>;
|
|
});
|
|
|
|
<span class="hljs-keyword">return</span> {
|
|
loading,
|
|
};
|
|
},
|
|
};
|
|
</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>\u53C2\u6570</th><th>\u8BF4\u660E</th><th>\u7C7B\u578B</th><th>\u9ED8\u8BA4\u503C</th></tr></thead><tbody><tr><td>row</td><td>\u6BB5\u843D\u5360\u4F4D\u56FE\u884C\u6570</td><td><em>number | string</em></td><td><code>0</code></td></tr><tr><td>row-width</td><td>\u6BB5\u843D\u5360\u4F4D\u56FE\u5BBD\u5EA6\uFF0C\u53EF\u4F20\u6570\u7EC4\u6765\u8BBE\u7F6E\u6BCF\u4E00\u884C\u7684\u5BBD\u5EA6</td><td><em>number | string |<br>(number | string)[]</em></td><td><code>100%</code></td></tr><tr><td>title</td><td>\u662F\u5426\u663E\u793A\u6807\u9898\u5360\u4F4D\u56FE</td><td><em>boolean</em></td><td><code>false</code></td></tr><tr><td>avatar</td><td>\u662F\u5426\u663E\u793A\u5934\u50CF\u5360\u4F4D\u56FE</td><td><em>boolean</em></td><td><code>false</code></td></tr><tr><td>loading</td><td>\u662F\u5426\u663E\u793A\u9AA8\u67B6\u5C4F\uFF0C\u4F20 <code>false</code> \u65F6\u4F1A\u5C55\u793A\u5B50\u7EC4\u4EF6\u5185\u5BB9</td><td><em>boolean</em></td><td><code>true</code></td></tr><tr><td>animate</td><td>\u662F\u5426\u5F00\u542F\u52A8\u753B</td><td><em>boolean</em></td><td><code>true</code></td></tr><tr><td>round</td><td>\u662F\u5426\u5C06\u6807\u9898\u548C\u6BB5\u843D\u663E\u793A\u4E3A\u5706\u89D2\u98CE\u683C</td><td><em>boolean</em></td><td><code>false</code></td></tr><tr><td>title-width</td><td>\u6807\u9898\u5360\u4F4D\u56FE\u5BBD\u5EA6</td><td><em>number | string</em></td><td><code>40%</code></td></tr><tr><td>avatar-size</td><td>\u5934\u50CF\u5360\u4F4D\u56FE\u5927\u5C0F</td><td><em>number | string</em></td><td><code>32px</code></td></tr><tr><td>avatar-shape</td><td>\u5934\u50CF\u5360\u4F4D\u56FE\u5F62\u72B6\uFF0C\u53EF\u9009\u503C\u4E3A <code>square</code></td><td><em>string</em></td><td><code>round</code></td></tr></tbody></table></div><div class="van-doc-card"><h3 id="lei-xing-ding-yi" tabindex="-1">\u7C7B\u578B\u5B9A\u4E49</h3><p>\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A</p><pre><code class="language-ts"><span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { <span class="hljs-title class_">SkeletonProps</span>, <span class="hljs-title class_">SkeletonAvatarShape</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'vant'</span>;
|
|
</code></pre></div><h2 id="zhu-ti-ding-zhi" tabindex="-1">\u4E3B\u9898\u5B9A\u5236</h2><div class="van-doc-card"><h3 id="yang-shi-bian-liang" tabindex="-1">\u6837\u5F0F\u53D8\u91CF</h3><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><table><thead><tr><th>\u540D\u79F0</th><th>\u9ED8\u8BA4\u503C</th><th>\u63CF\u8FF0</th></tr></thead><tbody><tr><td>--van-skeleton-row-height</td><td><em>16px</em></td><td>-</td></tr><tr><td>--van-skeleton-row-background-color</td><td><em>var(--van-active-color)</em></td><td>-</td></tr><tr><td>--van-skeleton-row-margin-top</td><td><em>var(--van-padding-sm)</em></td><td>-</td></tr><tr><td>--van-skeleton-title-width</td><td><em>40%</em></td><td>-</td></tr><tr><td>--van-skeleton-avatar-size</td><td><em>32px</em></td><td>-</td></tr><tr><td>--van-skeleton-avatar-background-color</td><td><em>var(--van-active-color)</em></td><td>-</td></tr><tr><td>--van-skeleton-animation-duration</td><td><em>1.2s</em></td><td>-</td></tr></tbody></table></div>`,12),l=[e],h={__name:"README.zh-CN",setup(o,{expose:s}){return s({frontmatter:{}}),(c,p)=>(t(),a("div",d,l))}};export{h as default};
|