Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/content/docs/2.components/editor-mention-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Use the `items` prop as an array of objects with the following properties:

- `label: string`{lang="ts-type"}
- `avatar?: AvatarProps`{lang="ts-type"}
- `color?: AvatarProps['color']`{lang="ts-type"}
- `icon?: IconComponent`{lang="ts-type"}
- `description?: string`{lang="ts-type"}
- `disabled?: boolean`{lang="ts-type"}
Expand Down
6 changes: 5 additions & 1 deletion src/runtime/components/EditorMentionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export interface EditorMentionMenuItem {
*/
icon?: IconComponent
avatar?: AvatarProps
/**
* Default `color` for the item's leading `B24Avatar`. Overridden by `avatar.color` when set.
*/
color?: AvatarProps['color']
disabled?: boolean
class?: any
[key: string]: any
Expand Down Expand Up @@ -93,7 +97,7 @@ onMounted(async () => {
item.icon
? h(item.icon, { class: styles.value.itemLeadingIcon() })
: item.avatar
? h(B24Avatar, { ...item.avatar, size: styles.value.itemLeadingAvatarSize(), class: styles.value.itemLeadingAvatar() })
? h(B24Avatar, { color: item.color, ...item.avatar, size: styles.value.itemLeadingAvatarSize(), class: styles.value.itemLeadingAvatar() })
: null,
h('span', { class: styles.value.itemWrapper() }, [
h('span', { class: styles.value.itemLabel() }, item.label),
Expand Down