-
Notifications
You must be signed in to change notification settings - Fork 96
feat(NcUserBubble): add RouterLink support #5708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -70,6 +70,7 @@ export default { | |||||
| <component :is="isLinkComponent" | ||||||
| class="user-bubble__content" | ||||||
| :style="styles.content" | ||||||
| :to="to" | ||||||
| :href="hasUrl ? url : null" | ||||||
| :class="{ 'user-bubble__content--primary': primary }" | ||||||
| v-bind="attrs" | ||||||
|
|
@@ -108,6 +109,7 @@ import NcUserBubbleDiv from './NcUserBubbleDiv.vue' | |||||
| import NcAvatar from '../NcAvatar/index.js' | ||||||
| import NcPopover from '../NcPopover/index.js' | ||||||
| import Vue from 'vue' | ||||||
| import { RouterLink } from 'vue-router' | ||||||
|
|
||||||
| export default { | ||||||
| name: 'NcUserBubble', | ||||||
|
|
@@ -160,6 +162,13 @@ export default { | |||||
| } | ||||||
| }, | ||||||
| }, | ||||||
| /** | ||||||
| * Use bubble as a router-link for in-app navigation | ||||||
| */ | ||||||
| to: { | ||||||
| type: [String, Object], | ||||||
| default: undefined, | ||||||
| }, | ||||||
| /** | ||||||
| * Default popover state. Requires the UserBubble | ||||||
| * to have some content to render inside the popover | ||||||
|
|
@@ -240,7 +249,9 @@ export default { | |||||
| }, | ||||||
|
|
||||||
| isLinkComponent() { | ||||||
| return this.hasUrl ? 'a' : 'div' | ||||||
| return this.hasUrl | ||||||
| ? (this.to ? RouterLink : 'a') | ||||||
| : 'div' | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved your suggestions, thanks! Can we address this in follow-up, maybe? or
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, let's do it in a follow up. It is not a part of the original issue. TBH I even don't remember, where we use use bubble with popover...
Antreesy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| }, | ||||||
|
|
||||||
| popoverEmpty() { | ||||||
|
|
@@ -329,4 +340,7 @@ export default { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| a.user-bubble__content { | ||||||
Antreesy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| cursor: pointer; | ||||||
| } | ||||||
| </style> | ||||||
Uh oh!
There was an error while loading. Please reload this page.