Refactor #3965 - For Avatar
parent
5ecc9e96f6
commit
78954bcc45
|
@ -3,7 +3,7 @@
|
|||
<slot>
|
||||
<span v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</span>
|
||||
<component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
||||
<span v-else-if="icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
||||
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
||||
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
|
||||
</slot>
|
||||
</div>
|
||||
|
|
|
@ -45,7 +45,7 @@ const classes = {
|
|||
}
|
||||
],
|
||||
label: 'p-avatar-text',
|
||||
icon: ({ props }) => ['p-avatar-icon', props.icon]
|
||||
icon: 'p-avatar-icon'
|
||||
};
|
||||
|
||||
const { load: loadStyle } = useStyle(styles, { id: 'primevue_avatar_style', manual: true });
|
||||
|
|
Loading…
Reference in New Issue