表格渲染 解决BootStrap3徽章没有背景颜色的问题(BootStrap4有)

 BootStrap3

//解决BootStrap3徽章没有背景颜色的问题(BootStrap4有)
formatter: function (value, row, index){
    if(dictionMapGlobal2 != null && dictionMapGlobal2.length > 0){
        var i = 0;
        while (i < dictionMapGlobal2.length){
            if(dictionMapGlobal2[i].key == value){
                var valueNew = value;
                if(value == 0){//未处理
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 1){//处理中
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 2){//待反馈
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 5){//完结
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == -1){//处理失败
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == -2){//无需处理
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }
                return valueNew;
            }
            i++;
        }
    }
}

BootStrap4(正常应该为)

formatter: function (value, row, index){
    if(dictionMapGlobal2 != null && dictionMapGlobal2.length > 0){
        var i = 0;
        while (i < dictionMapGlobal2.length){
            if(dictionMapGlobal2[i].key == value){
                var valueNew = value;
                if(value == 0){//未处理
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 1){//处理中
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 2){//待反馈
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == 5){//完结
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == -1){//处理失败
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }else if(value == -2){//无需处理
                    valueNew = '' + dictionMapGlobal2[i].value + '';
                }
                return valueNew;
            }
            i++;
        }
    }
}

你可能感兴趣的:(BootStrap,elementui,javascript,webview)