| 1 |
- import{c as t,o as a,A as e}from"./vendor.80bf15c7.js";const n={class:"markdown-body"},o=e('<h1>Avatar 头像</h1><h3>介绍</h3><p>用来代表用户或事物,支持图片、图标或字符展示。</p><h3>安装</h3><pre><code class="language-javascript">import { createApp } from 'vue';\nimport { Avatar } from '@nutui/nutui';\n\nconst app = createApp();\napp.use(Avatar);\n\n</code></pre><h2>代码示例</h2><h3>基本用法</h3><p>内置 smal / normal / large 三种尺寸规格</p><pre><code class="language-html"> <nut-avatar\n size="80"\n bg-image="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png"\n ></nut-avatar>\n <nut-avatar\n size="large"\n bg-image="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png"\n ></nut-avatar>\n <nut-avatar\n size="normal"\n bg-image="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png"\n ></nut-avatar>\n <nut-avatar\n size="small"\n bg-image="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png"\n ></nut-avatar> \n</code></pre><h3>修改形状类型</h3><pre><code class="language-html"> <nut-avatar shape="square"></nut-avatar>\n <nut-avatar shape="round"></nut-avatar>\n</code></pre><h3>修改背景色</h3><pre><code class="language-html"><nut-avatar bg-color="#f0250f"></nut-avatar>\n</code></pre><h3>修改背景icon</h3><pre><code class="language-html"> <nut-avatar\n bg-icon="https://img30.360buyimg.com/uba/jfs/t1/84318/29/2102/10483/5d0704c1Eb767fa74/fc456b03fdd6cbab.png"\n ></nut-avatar>\n</code></pre><h3>设置头像的文本内容</h3><pre><code class="language-html"><nut-avatar bg-icon>N</nut-avatar>\n</code></pre><h3>点击头像,触发事件</h3><pre><code class="language-html"><nut-avatar @active-avatar="activeAvatar"></nut-avatar>\n</code></pre><h3>Prop</h3><table><thead><tr><th>字段</th><th>说明</th><th>类型</th><th>默认值</th></tr></thead><tbody><tr><td>bg-color</td><td>设置头像背景色</td><td>String</td><td>#eee</td></tr><tr><td>size</td><td>设置头像的大小,提供三种:large/normal/small,支持直接输入数字</td><td>String</td><td>normal</td></tr><tr><td>shape</td><td>设置头像的形状,默认是圆形,可以设置为square方形</td><td>String</td><td>round</td></tr><tr><td>bg-image</td><td>设置头像的背景图片</td><td>String</td><td>‘’</td></tr><tr><td>bg-icon</td><td>设置头像的icon图标, 优先级低于bg-image,类似Icon组件的name属性,支持名称和链接</td><td>String</td><td>‘’</td></tr></tbody></table><h3>Events</h3><table><thead><tr><th>字段</th><th>说明</th><th>类型</th><th>回调参数</th></tr></thead><tbody><tr><td>active-avatar</td><td>点击头像触发事件</td><td>Function</td><td>event</td></tr></tbody></table>',23),r={expose:[],setup:e=>(e,r)=>(a(),t("div",n,[o]))};export default r;
|