Wrapping b-table in a child component
See original GitHub issueI’m trying to reduce boilerplate code by wrapping a b-table
in a component (including filter, pagination, etc.).
Utilising this wrapper component, I want to still be able to make use of named slots to do some formatting on the fields of the table.
However, the naive approach of ‘elevating’ the slots to the parent component doesn’t seem to work.
See this jsfiddle for an example on what 'm trying to accomplish.
VueJS documentation on use of named/scoped slots doesn’t seem to cover this use-case.
How should I approach this best using bootstrap-vue?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
ReactJS wrapping child component in div breaks table
ReactJS requires you to wrap every element being rendered in a parent div or element. This breaks tables and my responsive table I'm...
Read more >How to make container shrink-to-fit child elements as they wrap?
Direct child elements of the flexible container automatically ... The flex-wrap property states whether the flex items should wrap or not.
Read more >What is the best practice for wrapping <tr> and <td> in ... - Reddit
Not as the first wrapper in a component. I could use them in the table without ceasing child components, but using v-for in...
Read more >PatternFly 4 • Table
Wrap the content of each child row cell in ExpandableRowContent . Enclose each parent/child row pair in a Tbody component with an isExpanded...
Read more >Forwarding Refs - React
Ref forwarding is a technique for automatically passing a ref through a component to one of its children. This is typically not necessary...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works for me:
In child component:
In parent component
For future reference: I was revisiting this issue after the change to v-slot syntax and found a thread discussing this as well on SO. Perhaps it is of use to anyone.