How to write complex iView table columns?

how can the key, of the columns data of Table of

iView be the data under the object?

I mean:



  columns8: [
            {
                "title": "Name",
                "key": "name",
                "fixed": "left",
                "width": 200
            },
            {
                "title": "Show",
                "key": "show",
                "width": 150,
                "sortable": true,
            ...

generally speaking, this key is a string, like above.
when passing data, we pass the data, of table like this:

<table :data=data_list>                

data_list is as follows:

 [
      {
        name: "a",
        show: "hello a",
        ...  
      },
      {
        name: "b",
        show: "hello b",
        ...  
      },
      {
        name: "c",
        show: "hello c",
        ...  
      }
    ]

however, I have a requirement:

if data_list is like this:

         
 [
      {
        name: "a",
        obj: { show: "hello a", }
        ...  
      },
      {
        name: "b",
        obj: { show: "hello b", }
        ...  
      },
      {
        name: "c",
        obj: { show: "hello c", }
        ...  
      }
    ]

how should I write the columns of table?

Mar.05,2021

the format needed to convert the data into iview's table


use the render function,

{
    title: 'Show',
    key: 'Show',
    align: 'center',
    render: (h, params) => params.row.obj.show
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a491-4d89d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a491-4d89d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?