ant-design-vue/components/avatar/demo/index.vue

57 lines
1.3 KiB
Vue
Raw Normal View History

2017-11-09 10:57:34 +00:00
<template>
<div>
<div>
<avatar size="large" icon="user"/>
<avatar icon="user"/>
<avatar size="small" icon="user"/>
</div>
2017-11-16 10:29:02 +00:00
<br/>
2017-11-09 10:57:34 +00:00
<div>
<avatar shape="square" size="large" icon="user" />
<avatar shape="square" icon="user" />
<avatar shape="square" size="small" icon="user" />
</div>
2017-11-16 10:29:02 +00:00
<br/>
2017-11-09 10:57:34 +00:00
<div>
<avatar icon="user" />
<avatar>U</avatar>
<avatar>USER</avatar>
<avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
2017-11-10 02:28:49 +00:00
<avatar :styles="{ color: '#f56a00', backgroundColor: '#fde3cf' }">U</avatar>
<avatar :styles="{ backgroundColor: '#87d068' }" icon="user" />
2017-11-09 10:57:34 +00:00
</div>
2017-11-16 10:29:02 +00:00
<br/>
2017-11-09 10:57:34 +00:00
<div>
<avatar shape="square" size="large">{{avatarValue}}</avatar>
<AntButton @click="changeValue"></AntButton>
</div>
2017-11-16 10:29:02 +00:00
<br/>
<div>
<Badge count=1><Avatar shape="square" icon="user" /></Badge>
<br/>
<Badge dot><Avatar shape="square" icon="user" /></Badge>
</div>
2017-11-09 10:57:34 +00:00
</div>
</template>
<script>
import '../style'
2017-11-16 10:29:02 +00:00
import { Avatar, Button, Badge } from 'antd/index'
2017-11-09 10:57:34 +00:00
export default {
data () {
return {
avatarValue: 'current',
}
},
methods: {
changeValue () {
this.avatarValue = 'changed'
},
},
components: {
Avatar,
AntButton: Button,
2017-11-16 10:29:02 +00:00
Badge,
2017-11-09 10:57:34 +00:00
},
}
</script>