mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
parent
a2cd63672b
commit
a8f3e2d5e3
12 changed files with 56 additions and 41 deletions
|
@ -1,10 +1,12 @@
|
|||
<template>
|
||||
<div :class="containerClass" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel">
|
||||
<slot>
|
||||
<slot></slot>
|
||||
<template v-if="!$slots.default">
|
||||
<span v-if="label" class="p-avatar-text">{{ label }}</span>
|
||||
<span v-else-if="icon" :class="iconClass"></span>
|
||||
<component v-else-if="$slots.icon" :is="$slots.icon" class="p-avatar-icon" />
|
||||
<span v-else-if="icon" :class="['p-avatar-icon', icon]" />
|
||||
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" />
|
||||
</slot>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -58,9 +60,6 @@ export default {
|
|||
'p-avatar-xl': this.size === 'xlarge'
|
||||
}
|
||||
];
|
||||
},
|
||||
iconClass() {
|
||||
return ['p-avatar-icon', this.icon];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue