return<div>My custom content for row {row.id}</div>
}
...
}
Using a component name or a `.vue` file: (See Templates for a complete example)
options:{
...
childRow:'row-component'
...
}
When the plugin detects a `childRow` function it appends the child rows and prepends to each row an additional toggler column with a `span` you can design to your liking.
Example styling (also found in `style.css`):
.VueTables__child-row-toggler{
width: 16px;
height: 16px;
line-height: 16px;
display: block;
margin: auto;
text-align: center;
}
.VueTables__child-row-toggler--closed::before{
content:"+";
}
.VueTables__child-row-toggler--open::before{
content:"-";
}
You can also trigger the child row toggler programmtically. E.g, to toggle the row with an id of 4:
this.$refs.myTable.toggleChildRow(4);// replace myTable with your own ref
Alternatively, you can use the `showChildRowToggler` option to prevent the child row toggler cells from being rendered. (See Options API)
Disabling Specific Child Rows
Sometimes there are some child rows that have no content. You can disable the togglers for these rows by providing the logic to the disabledChildRows option, e.g: