mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactored Button
This commit is contained in:
parent
03ca6c89ab
commit
b635047cd0
3 changed files with 4 additions and 36 deletions
|
@ -8,7 +8,7 @@
|
|||
<slot v-else name="icon" :class="[cx('icon')]">
|
||||
<span v-if="icon" :class="[cx('icon'), icon, iconClass]" v-bind="ptm('icon')"></span>
|
||||
</slot>
|
||||
<span :class="cx('label')" v-bind="ptm('label')">{{ label || ' ' }}</span>
|
||||
<span v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</span>
|
||||
<Badge v-if="badge" :value="badge" :class="badgeClass" :severity="badgeSeverity" :unstyled="unstyled" v-bind="ptm('badge')"></Badge>
|
||||
</slot>
|
||||
</button>
|
||||
|
|
|
@ -6,9 +6,7 @@ const classes = {
|
|||
{
|
||||
'p-button-icon-only': instance.hasIcon && !props.label && !props.badge,
|
||||
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
||||
'p-disabled': instance.$attrs.disabled || instance.$attrs.disabled === '' || props.loading,
|
||||
'p-button-loading': props.loading,
|
||||
'p-button-loading-label-only': props.loading && !instance.hasIcon && props.label,
|
||||
'p-button-link': props.link,
|
||||
[`p-button-${props.severity}`]: props.severity,
|
||||
'p-button-raised': props.raised,
|
||||
|
@ -20,14 +18,11 @@ const classes = {
|
|||
'p-button-plain': props.plain
|
||||
}
|
||||
],
|
||||
loadingIcon: 'p-button-loading-icon pi-spin',
|
||||
loadingIcon: 'p-button-loading-icon',
|
||||
icon: ({ props }) => [
|
||||
'p-button-icon',
|
||||
{
|
||||
'p-button-icon-left': props.iconPos === 'left' && props.label,
|
||||
'p-button-icon-right': props.iconPos === 'right' && props.label,
|
||||
'p-button-icon-top': props.iconPos === 'top' && props.label,
|
||||
'p-button-icon-bottom': props.iconPos === 'bottom' && props.label
|
||||
[`p-button-icon-${props.iconPos}`]: props.label
|
||||
}
|
||||
],
|
||||
label: 'p-button-label'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue