diff --git a/docs/content/2.elements/3.avatar.md b/docs/content/2.elements/3.avatar.md index 62b87ad7..a33657ab 100644 --- a/docs/content/2.elements/3.avatar.md +++ b/docs/content/2.elements/3.avatar.md @@ -55,7 +55,7 @@ If there is an error loading the `src` of the avatar or `src` is null / false a #### Icon :u-badge{label="Edge" class="ml-2 align-text-bottom !rounded-full" variant="subtle"} -You can use the `icon` prop to display an icon on top of the background, customizable in `ui.avatar.icon`. +You can use the `icon` prop to display an icon on top of the background or globally in `ui.avatar.default.icon`. Defaults to `null`. ::component-card --- diff --git a/src/runtime/app.config.ts b/src/runtime/app.config.ts index 0dd3abc8..598d558a 100644 --- a/src/runtime/app.config.ts +++ b/src/runtime/app.config.ts @@ -113,6 +113,7 @@ const avatar = { }, default: { size: 'sm', + icon: null, chipColor: null, chipPosition: 'top-right' } diff --git a/src/runtime/components/elements/Avatar.vue b/src/runtime/components/elements/Avatar.vue index ebb0370e..ea8a4ce3 100644 --- a/src/runtime/components/elements/Avatar.vue +++ b/src/runtime/components/elements/Avatar.vue @@ -52,7 +52,7 @@ export default defineComponent({ }, icon: { type: String, - default: null + default: () => appConfig.ui.avatar.default.icon }, size: { type: String,