fix card dynamic

pull/9/head
wangxueliang 2018-01-28 20:30:25 +08:00
parent 4042b51761
commit 8a91d4a17b
2 changed files with 21 additions and 0 deletions

View File

@ -9,6 +9,25 @@ For letter type Avatar, when the letters are too long to display, the font size
</us> </us>
```html ```html
<script>
const UserList = ['U', 'Lucy', 'Tom', 'Edward']
const colorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae']
export default {
data () {
return {
avatarValue: UserList[0],
color: colorList[0],
}
},
methods: {
changeValue () {
const index = UserList.indexOf(this.avatarValue)
this.avatarValue = index < UserList.length - 1 ? UserList[index + 1] : UserList[0]
this.color = index < colorList.length - 1 ? colorList[index + 1] : colorList[0]
},
},
}
</script>
<template> <template>
<div> <div>
<a-avatar shape="square" size="large" :style="{'backgroundColor': color}">{{avatarValue}}</a-avatar> <a-avatar shape="square" size="large" :style="{'backgroundColor': color}">{{avatarValue}}</a-avatar>

View File

@ -41,6 +41,8 @@ export default {
<br/> <br/>
<Type/> <Type/>
<br/> <br/>
<Dynamic/>
<br/>
<api> <api>
<template slot='cn'> <template slot='cn'>
<CN/> <CN/>