vuestic-ui
vuestic-ui copied to clipboard
VaAvatar improvements
Features we want:
- [x] fallback to text and image
- [x] somehow avatar group
- [ ] gravatar integration example (shouldn't be part of component api)
- [x] add example with badge
Examples we want:
- [ ] we need to tell that you can globally set a fallback for avatar component (as users might not be able to figure that out on themselves)
Reference
- https://www.naiveui.com/en-US/os-theme/components/avatar#fallback.vue
I would like to discuss about fallback
property implementation.
- The
fallback
property should have a string type. - If we prepend
image | icon | text
text to it, then component should render fallback with given type. For example:
<va-avatar src="path/not/exists" fallback="icon:profile" />
<va-avatar src="path/not/exists" fallback="image:path/to/fallback-image" />
<va-avatar src="path/not/exists" fallback="text:Not found" />
Or instead of creating as property, we can implement it as custom vue directive:
<va-avatar src="path/not/exists" va-fallback.icon="profile" />
<va-avatar src="path/not/exists" va-fallback.image="path/to/fallback-image" />
<va-avatar src="path/not/exists" va-fallback.text="Not found" />
Let's have a docs example with gravatar.