Skip to content

Commit

Permalink
feat(Avatar): handle icon default from app.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Aug 4, 2023
1 parent 824ebb1 commit bf56a03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/content/2.elements/3.avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
1 change: 1 addition & 0 deletions src/runtime/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const avatar = {
},
default: {
size: 'sm',
icon: null,
chipColor: null,
chipPosition: 'top-right'
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default defineComponent({
},
icon: {
type: String,
default: null
default: () => appConfig.ui.avatar.default.icon
},
size: {
type: String,
Expand Down

1 comment on commit bf56a03

@vercel
Copy link

@vercel vercel bot commented on bf56a03 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-git-dev-nuxtlabs.vercel.app
ui-nuxtlabs.vercel.app
ui.nuxtlabs.com

Please sign in to comment.