Refactor #3965 - For Tag

pull/3997/head
Tuğçe Küçükoğlu 2023-05-25 17:43:25 +03:00
parent 42345f106f
commit 58690ee93f
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ const classes = {
'p-tag-rounded': props.rounded
}
],
icon: ({ props }) => ['p-tag-icon', props.icon],
icon: 'p-tag-icon',
value: 'p-tag-value'
};

View File

@ -1,7 +1,7 @@
<template>
<span :class="cx('root')" v-bind="ptm('root')">
<component v-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')"></span>
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></span>
<slot>
<span :class="cx('value')" v-bind="ptm('value')">{{ value }}</span>
</slot>