Skip to content

Commit bf56a03

Browse files
committed
feat(Avatar): handle icon default from app.config.ts
1 parent 824ebb1 commit bf56a03

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/content/2.elements/3.avatar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If there is an error loading the `src` of the avatar or `src` is null / false a
5555

5656
#### Icon :u-badge{label="Edge" class="ml-2 align-text-bottom !rounded-full" variant="subtle"}
5757

58-
You can use the `icon` prop to display an icon on top of the background, customizable in `ui.avatar.icon`.
58+
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`.
5959

6060
::component-card
6161
---

src/runtime/app.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const avatar = {
113113
},
114114
default: {
115115
size: 'sm',
116+
icon: null,
116117
chipColor: null,
117118
chipPosition: 'top-right'
118119
}

src/runtime/components/elements/Avatar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default defineComponent({
5252
},
5353
icon: {
5454
type: String,
55-
default: null
55+
default: () => appConfig.ui.avatar.default.icon
5656
},
5757
size: {
5858
type: String,

0 commit comments

Comments
 (0)