Skip to content
Advertisement

Access parent component scope in b-table slot

Im using a v-slot in a <b-table> so I can create a link.

The first part of the link contains data from the datasource. However the querystring has a parameter that I need to include in the link. How can I get scope to my data that holds the querystring value so I can add the querystring to the link in my v-slot?

Thank you in advance, Marty

JavaScript
JavaScript

Advertisement

Answer

The <a> is parent content that is being passed into the <b-table> slot, and that means it has access to the parent data. So you can access the companyId directly just as you would if there was no <b-table>:

JavaScript

For route links, it’s best to use <router-link> instead of an <a> tag:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement