fastadmin 根据字段控制开关按钮显示与隐藏

fastadmin 根据字段值控制开关按钮显示与隐藏,修改js文件,直接上代码:

 {
                            field: 'is_active',
                            title: __('Is_active'),
                            searchList: {"0":__('Is_active 0'),"1":__('Is_active 1')},
                            formatter:function (value, row, index) {
                                if (row.type != 2) {
                                    // 当行数据对应的type字段不等于2时,才显示开关按钮
                                    return Table.api.formatter.toggle.call(this,value,row,index);
                                }
                            },
},

  

  

posted @ 2022-08-03 11:39  大雄呀  阅读(1604)  评论(0编辑  收藏  举报