How to use table of iview to dynamically show and hide tr?

how to show / hide rows without push,splice the bound data of table? Do you use v-show or v-if or do you implement it directly in render?

Mar.01,2021

write the columns data not in data, but in the methods initialization method, and then set a show hidden flag bit to determine whether to add to the columns according to the flag bit. For example,

<Table border :columns="Columns" :data="Data"></Table>

export default{
    data(){
        return {
            flag:true, //
            Columns:[],
            Data:[{
                name:''
            }]
        }
    },
    mounted(){
        this.init()
    },
    methods:{
        init(){
            this.Columns=[{
                title: '',
                key: 'name',
                align:'center',
            }]
            
            if(flag){
                this.Columns.push({...}) //
            }
        }
    }
}

use another array to save the hidden display state of each row of data

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