feat(Avatar): handle chipText (#306)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
JPB
2023-06-22 15:54:56 +05:30
committed by GitHub
parent 48636363d1
commit 759af058df
4 changed files with 21 additions and 12 deletions

View File

@@ -3,7 +3,9 @@
<img v-if="url && !error" :class="avatarClass" :src="url" :alt="alt" :onerror="() => onError()">
<span v-else-if="text || placeholder" :class="ui.placeholder">{{ text || placeholder }}</span>
<span v-if="chipColor" :class="chipClass" />
<span v-if="chipColor" :class="chipClass">
{{ chipText }}
</span>
<slot />
</span>
</template>
@@ -55,6 +57,10 @@ export default defineComponent({
return Object.keys(appConfig.ui.avatar.chip.position).includes(value)
}
},
chipText: {
type: [String, Number],
default: null
},
ui: {
type: Object as PropType<Partial<typeof appConfig.ui.avatar>>,
default: () => appConfig.ui.avatar