Initing child components with no associated dom
See original GitHub issueHi!
in several components I find myself doing few workaround to accomplish the child components be a simple data representation.
Example 1 - Table
<vk-table>
<vk-table-column header="Name">Cell Content</vk-table-column>
<vk-table-column header="Name">Cell Content</vk-table-column>
</vk-table>
The vk-table-column
purpose is to collect the data but leverage the rendering to vk-table
which will iterate over the children as necessary to accomplish the Header, Rows, Cell combination.
Example 2 - Tabs
<vk-tabs>
<vk-tab label="Name">Tab Content</vk-tab>
<vk-tab label="Name">Tab Content</vk-tab>
</vk-tabs>
Similar as in previous example but additionally the Tabs content should be rendered using single Transition.
To the point
In both examples, the children can’t be used out the default way to accomplish the special rendering. There are several workarounds but are tricky, unsupported and of course not best practice, so I would like to start a discussion about solving this particular need.
A solution could be having a way to initiate those $children with no render or template set as out of document components. They would be accessible early in the parent for immediate use during rendering.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:16 (7 by maintainers)
Top GitHub Comments
@Alendorff as far as I understood
Vue.prototype._l
is a short hand forrenderList
the helper used byv-for
so vue template code
in jsx would be
Ok, let me put all the cards on the table. This is an adapted extract of a real component workflow:
VkTable
VkTableColumn
VkTableColumnSelect
Usage
Conclusions