parent
7befb78ba5
commit
9f244f3719
5 changed files with 130 additions and 8 deletions
@ -0,0 +1,23 @@ |
||||
<template> |
||||
<div> |
||||
<a-card :bordered="false"> |
||||
<a-tooltip slot="title" title="test" > |
||||
<a-avatar src="https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png" /> |
||||
</a-tooltip> |
||||
</a-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import ACard from 'vue-antd-ui/es/card/Card' |
||||
import ATooltip from 'vue-antd-ui/es/tooltip/Tooltip' |
||||
import AAvatar from 'vue-antd-ui/es/avatar/Avatar' |
||||
export default { |
||||
name: 'BasicDetail', |
||||
components: {AAvatar, ATooltip, ACard} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
|
||||
</style> |
@ -0,0 +1,74 @@ |
||||
<template> |
||||
<div class="avatar-list"> |
||||
<ul> |
||||
<slot> |
||||
</slot> |
||||
</ul> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import AAvatar from 'vue-antd-ui/es/avatar/Avatar' |
||||
import ATooltip from 'vue-antd-ui/es/tooltip/Tooltip' |
||||
const Item = { |
||||
name: 'AvatarListItem', |
||||
props: { |
||||
size: { |
||||
type: String, |
||||
required: false, |
||||
default: 'small' |
||||
}, |
||||
src: { |
||||
type: String, |
||||
required: true |
||||
}, |
||||
tips: { |
||||
type: String, |
||||
required: false |
||||
} |
||||
}, |
||||
methods: { |
||||
renderAvatar (h, size, src) { |
||||
return h(AAvatar, {props: {size: size, src: src}}, []) |
||||
} |
||||
}, |
||||
render (h) { |
||||
const avatar = this.renderAvatar(h, this.$props.size, this.$props.src) |
||||
return h( |
||||
'li', |
||||
{class: 'avatar-item'}, |
||||
[!this.$props.tips ? h(ATooltip, {props: {title: this.$props.tips}}, [avatar]) : avatar] |
||||
) |
||||
} |
||||
} |
||||
export default { |
||||
name: 'AvatarList', |
||||
components: {ATooltip}, |
||||
Item: Item |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
.avatar-list { |
||||
display: inline-block; |
||||
ul { |
||||
display: inline-block; |
||||
margin-left: 8px; |
||||
font-size: 0; |
||||
.avatar-item { |
||||
display: inline-block; |
||||
font-size: 14px; |
||||
margin-left: -8px; |
||||
width: 20px; |
||||
height: 20px; |
||||
:global { |
||||
.ant-avatar { |
||||
border: 1px solid #fff; |
||||
width: 20px; |
||||
height: 20px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue