Refactor #3965 - For Avatar

pull/3997/head
Tuğçe Küçükoğlu 2023-05-25 17:41:58 +03:00
parent 5ecc9e96f6
commit 78954bcc45
2 changed files with 2 additions and 2 deletions

View File

@ -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>

View File

@ -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 });