layui/example/docs/zh-CN/components/avatar.md

97 lines
1.4 KiB
Markdown
Raw Normal View History

2021-10-25 17:13:23 +00:00
::: title 基础使用
2021-10-19 14:28:44 +00:00
:::
2021-10-01 12:22:49 +00:00
::: demo
<template>
<lay-avatar :src="src"></lay-avatar>
2021-10-01 12:22:49 +00:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const src = ref("https://portrait.gitee.com/uploads/avatars/user/2813/8441097_shaynas_1610801433.png")
2021-10-01 12:22:49 +00:00
return {
src
2021-10-01 12:22:49 +00:00
}
}
}
</script>
:::
2021-10-25 17:13:23 +00:00
::: title 圆角头像
2021-10-19 14:28:44 +00:00
:::
2021-10-01 12:22:49 +00:00
::: demo
<template>
<lay-avatar :src="src" radius></lay-avatar>
2021-10-01 12:22:49 +00:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const src = "https://portrait.gitee.com/uploads/avatars/user/2813/8441097_shaynas_1610801433.png"
2021-10-01 12:22:49 +00:00
return {
src
2021-10-01 12:22:49 +00:00
}
}
}
</script>
:::
2021-10-25 17:13:23 +00:00
::: title 尺寸大小
2021-10-19 14:28:44 +00:00
:::
2021-10-01 12:22:49 +00:00
::: demo
<template>
<lay-avatar :src="src" size="xs"></lay-avatar>
<lay-avatar :src="src" size="sm"></lay-avatar>
<lay-avatar :src="src"></lay-avatar>
<lay-avatar :src="src" size="lg"></lay-avatar>
2021-10-01 12:22:49 +00:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const src = "https://portrait.gitee.com/uploads/avatars/user/2813/8441097_shaynas_1610801433.png"
2021-10-01 12:22:49 +00:00
return {
2021-11-07 07:55:08 +00:00
src
2021-10-01 12:22:49 +00:00
}
}
}
</script>
2021-10-01 12:22:49 +00:00
:::
2021-10-25 17:13:23 +00:00
::: title 头像属性
:::
2021-10-12 10:00:09 +00:00
2021-11-07 07:55:08 +00:00
::: table
| 属性 | 描述 | 可选值 |
| ------ | ---- | -------------- |
| src | 图源 | -- |
| size | 尺寸 | `xs` `sm` `lg` |
| radius | 圆形 | `true` `false` |
2021-11-07 07:55:08 +00:00
2021-11-07 07:56:24 +00:00
:::
2021-12-16 09:57:59 +00:00
::: comment
:::