Refactor #3965 - Refactor on class implementation

This commit is contained in:
Tuğçe Küçükoğlu 2023-07-06 15:13:28 +03:00
parent eddfa1a5ef
commit b4d07f0176
11 changed files with 12 additions and 17 deletions

View file

@ -12,7 +12,6 @@ const classes = {
}
],
icon: ({ instance, props }) => [
props.modelValue ? props.onIcon : props.offIcon,
'p-button-icon',
{
'p-button-icon-left': props.iconPos === 'left' && instance.label,

View file

@ -17,7 +17,7 @@
/>
</span>
<slot name="icon" :value="modelValue" :class="cx('icon')">
<span v-if="onIcon || offIcon" :class="cx('icon')" v-bind="ptm('icon')" />
<span v-if="onIcon || offIcon" :class="[cx('icon'), modelValue ? onIcon : offIcon]" v-bind="ptm('icon')" />
</slot>
<span :class="cx('label')" v-bind="ptm('label')">{{ label }}</span>
</div>