This is the largest PR so far. Over the years I've made a table component many times, but this time it is different. I've always wanted to only import a single prop-less component and define a single object which I will pass to it as a prop. That's it. Whole definition happens outside of the UI code.
Unfortuantely, in Vue this comes at a cost of customization. Since we can't define small atomic sub-components within our SFCs, we need to move part of the setup to the HTML code itself.
The whole idea behind this is that you can write any UI you want. It doesn't even need to be inside a table. Just note that all components exported from the /table folder should be used within the <Table /> component slots.
There are many ways to tweak & update the way the table behaves and looks, but that will be covered in the final documentation later.
This is the largest PR so far. Over the years I've made a table component many times, but this time it is different. I've always wanted to only import a single prop-less component and define a single object which I will pass to it as a prop. That's it. Whole definition happens outside of the UI code.
Unfortuantely, in Vue this comes at a cost of customization. Since we can't define small atomic sub-components within our SFCs, we need to move part of the setup to the HTML code itself.
How it works?
We define table dataset using the
defineTable
And we can now define the table UI in the template itself
Which results in this
The whole idea behind this is that you can write any UI you want. It doesn't even need to be inside a table. Just note that all components exported from the
/table
folder should be used within the<Table />
component slots.There are many ways to tweak & update the way the table behaves and looks, but that will be covered in the final documentation later.