Skip to content

Commit

Permalink
feat(Avatar)!: bind component attributes to img element (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
sduduzog committed Jul 17, 2023
1 parent 7554a10 commit 773a23f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<template>
<span :class="wrapperClass">
<img v-if="url && !error" :class="avatarClass" :src="url" :alt="alt" :onerror="() => onError()">
<img
v-if="url && !error"
:class="avatarClass"
:alt="alt"
:src="url"
v-bind="$attrs"
:onerror="() => onError()"
>
<span v-else-if="text || placeholder" :class="ui.placeholder">{{ text || placeholder }}</span>

<span v-if="chipColor" :class="chipClass">
Expand All @@ -23,6 +30,7 @@ import appConfig from '#build/app.config'
// const appConfig = useAppConfig()
export default defineComponent({
inheritAttrs: false,
props: {
src: {
type: [String, Boolean],
Expand Down

0 comments on commit 773a23f

Please sign in to comment.