dwqs / v2-table

A simple table component based Vue 2.x: https://dwqs.github.io/v2-table/
MIT License
100 stars 24 forks source link

How to show nested objects table #23

Open smarthingsolutions opened 5 years ago

smarthingsolutions commented 5 years ago

Hello,

how can i use v2 table to print a nested objects table. let's say i got from backend (laravel controller) a list of products with their sales (product->with('sales')->get()), and each product has a different number of sales.

i want to show them like this : ( sales table inside each product row)

 id      |            Product       |                sales                         |   

  1      |           Product_1      |   id      |      sale        |     price

                                       1        |    sale_1        |    price_1                                                                              
                                       2        |    sale_2        |    price_2

  2      |           Product_2      |   id      |      sale        |     price

                                       3        |    sale_3        |    price_3                                                                                
                                       4        |    sale_4        |    price_4
                                       5        |    sale_5        |    price_5