Refactor #3965 - Update Avatar data-pc-* structure

pull/3997/head
Bahadır Sofuoğlu 2023-05-24 12:27:18 +03:00
parent 1d615bb05d
commit 32b4d9bd2d
1 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')" data-pc-name="avatar" data-pc-section="root"> <div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')">
<slot> <slot>
<span v-if="label" :class="cx('label')" v-bind="ptm('label')" data-pc-section="label">{{ label }}</span> <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')" data-pc-section="icon" /> <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')" data-pc-section="icon" /> <span v-else-if="icon" :class="cx('icon')" v-bind="ptm('icon')" />
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" data-pc-section="image" /> <img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
</slot> </slot>
</div> </div>
</template> </template>