Merge pull request #6765 from Stawlie/fix-6747

Button: Added "loadingIcon" and "icon" pt options to its slots
pull/6775/head
Tuğçe Küçükoğlu 2024-11-13 11:10:43 +03:00 committed by GitHub
commit a697e18a51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
<template> <template>
<component v-if="!asChild" :is="as" v-ripple :class="cx('root')" v-bind="attrs"> <component v-if="!asChild" :is="as" v-ripple :class="cx('root')" v-bind="attrs">
<slot> <slot>
<slot v-if="loading" name="loadingicon" :class="[cx('loadingIcon'), cx('icon')]"> <slot v-if="loading" name="loadingicon" :class="[cx('loadingIcon'), cx('icon')]" v-bind="ptm('loadingIcon')">
<span v-if="loadingIcon" :class="[cx('loadingIcon'), cx('icon'), loadingIcon]" v-bind="ptm('loadingIcon')" /> <span v-if="loadingIcon" :class="[cx('loadingIcon'), cx('icon'), loadingIcon]" v-bind="ptm('loadingIcon')" />
<SpinnerIcon v-else :class="[cx('loadingIcon'), cx('icon')]" spin v-bind="ptm('loadingIcon')" /> <SpinnerIcon v-else :class="[cx('loadingIcon'), cx('icon')]" spin v-bind="ptm('loadingIcon')" />
</slot> </slot>
<slot v-else name="icon" :class="[cx('icon')]"> <slot v-else name="icon" :class="[cx('icon')]" v-bind="ptm('icon')">
<span v-if="icon" :class="[cx('icon'), icon, iconClass]" v-bind="ptm('icon')"></span> <span v-if="icon" :class="[cx('icon'), icon, iconClass]" v-bind="ptm('icon')"></span>
</slot> </slot>
<span :class="cx('label')" v-bind="ptm('label')">{{ label || '&nbsp;' }}</span> <span :class="cx('label')" v-bind="ptm('label')">{{ label || '&nbsp;' }}</span>