question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: pass a component to display in the Popover

See original GitHub issue

It would be really useful (at least to me) to be able to specify a Vue component to display inside the popover (when using the directive).

<span v-b-popover.hover="popoverConfig">{{ user.username }}</span>

...

data() {
    return {
        popoverConfig: {
            props: {
                user: this.user,
            },
            component: {
                name: 'profile-component',
                props: ['user'],
                template: `
                    <b-card :title="user.username" :img-src="user.avatar" img-top>
                        <p class="card-text">{{ user.bio }}</p>
                    </b-card>
                `
            }
        }
    } 
}

Inside the popover, this can be implemented with something like:

<component :is="b-popover.component" v-bind="b-popover.props"></component>

This feature would greatly enhance the popover component, making it able to display absolutely anything, encouraging modularization of code reuse.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
alsciendecommented, Sep 3, 2017

I found a solution by using a function as value for v-b-popover. It does exactly as what I need: https://jsfiddle.net/7h4tpouz/3/.

Thank you for your help. I think this feature request can be closed.

1reaction
tmorehousecommented, Sep 3, 2017

Note that while this method works for trigger a single hover (rr focus, but not both), it may not work for click properly.

Your best (safest) bet would be to generate an HTML string with the appropriate HTML markup for a card, which has your content interpolated into the HTML string template, or use document.elementCreate(...), Element.appendChild, etc to generate a DOM structure to pass to v-b-popover

Read more comments on GitHub >

github_iconTop Results From Across the Web

Popovers - Bootstrap
Documentation and examples for adding Bootstrap popovers, like those found in iOS, to any element on your site.
Read more >
Popover | Components - BootstrapVue
The Popover feature provides a tooltip-like behavior, can be easily applied to any interactive element via the component or v-b-popover directive.
Read more >
Show one popover and hide other popovers - Stack Overflow
In my scripts I don't pass vars through the data attribute in the HTML, I prefer the logic in my js files. $(".vote").popover({...
Read more >
Popover on hovering a Cell in the Gantt React Component
My goal would be that a popover appears on hover over one of the yellow marked elements, wich contains two links to other...
Read more >
Popovers - Bootstrap - University of Houston
Popovers · Plugin dependency · Opt-in functionality · Popovers in button groups and input groups require special setting · Don't try to show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found