The table component in iview, how to make the number with a median value of 0 in the grid displayed in green

clipboard.png

the table component in iview, how to make the numbers with a median value of 0 in the grid display in green and the rest in red

Feb.28,2021

just use the render function and then use a ternary expression for backgroundColor

render: (h, params) => {
    return h('span', {
            style: {
                backgroundColor:  (params.row.status == 0) ? "-sharp2d8cf0" :"-sharped3f14"

params.row is a single object of the current line. Just judge from the corresponding fields in this object

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-1b2b9b1-2baa3.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-1b2b9b1-2baa3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?