iview table表格中的checkBox设置为单选

{
                        width: 60,
                        align: "center",
                        key: 'checkBox',
                        _isChecked: false,
                        resizable: true,
                        render:(h,params)=>{
                            return h('div',[
                                h('Checkbox',{
                                    props:{
                                        value:params.row.checkBox
                                    },
                                    on:{
                                        'on-change':(e)=>{
                                            this.tableData.forEach((items)=>{
                                                this.$set(items,'checkBox',false)
                                            });
                                            this.tableData[params.index].checkBox = e;
                                        }
                                    }
                                })
                            ])
                        }
                    }

 

posted @ 2022-06-20 09:57  土小狗  阅读(801)  评论(0编辑  收藏  举报