Fixed #3905 - Button: No label

pull/3913/head
mertsincan 2023-04-27 13:18:17 +01:00
parent 2141a3af61
commit 3fbd5c04e3
3 changed files with 6 additions and 9 deletions

View File

@ -1,12 +1,11 @@
<template>
<div :class="containerClass" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<span v-if="label" class="p-avatar-text" v-bind="ptm('label')">{{ label }}</span>
<component v-else-if="$slots.icon" :is="$slots.icon" class="p-avatar-icon" v-bind="ptm('icon')" />
<span v-else-if="icon" :class="['p-avatar-icon', icon]" v-bind="ptm('icon')" />
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
</template>
</slot>
</div>
</template>

View File

@ -1,7 +1,6 @@
<template>
<button v-ripple :class="buttonClass" type="button" :aria-label="defaultAriaLabel" :disabled="disabled" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<slot v-if="loading" name="loadingicon" :class="loadingIconStyleClass">
<span v-if="loadingIcon" :class="[loadingIconStyleClass, loadingIcon]" v-bind="ptm('loadingIcon')" />
<SpinnerIcon v-else :class="loadingIconStyleClass" spin v-bind="ptm('loadingIcon')" />
@ -11,7 +10,7 @@
</slot>
<span class="p-button-label" v-bind="ptm('label')">{{ label || '&nbsp;' }}</span>
<span v-if="badge" :class="badgeStyleClass" v-bind="ptm('badge')">{{ badge }}</span>
</template>
</slot>
</button>
</template>

View File

@ -1,12 +1,11 @@
<template>
<div v-if="visible" :class="containerClass" :aria-label="label" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<img v-if="image" :src="image" v-bind="ptm('image')" />
<component v-else-if="$slots.icon" :is="$slots.icon" class="p-chip-icon" v-bind="ptm('icon')" />
<span v-else-if="icon" :class="['p-chip-icon', icon]" v-bind="ptm('icon')" />
<div v-if="label" class="p-chip-text" v-bind="ptm('label')">{{ label }}</div>
</template>
</slot>
<slot v-if="removable" name="removeicon" :onClick="close" :onKeydown="onKeydown">
<component :is="removeIcon ? 'span' : 'TimesCircleIcon'" tabindex="0" :class="['p-chip-remove-icon', removeIcon]" @click="close" @keydown="onKeydown" v-bind="ptm('removeIcon')"></component>
</slot>