7.0 pipe symbol

Used | 1. vue of the pipeline operator ()

// custom filters, through the pipeline operator | change the value of the cell list
 < EL Table-column-
     prop = "Status" 
    label = "Status" 
    align = left = "Center" 
    width = "80" > 
    < Template slot-scope = "scope" > 
        {{scope.row.status | the getStatus}} 
    </ Template > 
</ EL-Table-column > 

< Script >     
    Export default { 
        Data () { 
            return {......}                      
        }, 
        Filters : { 
            getStatus:function(num){ 
                STR the let =  '' 
                IF (NUM ==  . 1 ) { 
                    STR =  ' enabled ' 
                } the else { 
                    STR =  ' disabled ' 
                } 
                return STR; 
            } 
        }, 
        Methods: { 
            List ()} ...... {,                                        
        }, 
    } 
</ Script >
View Code

 Reference: Custom filter

Guess you like

Origin www.cnblogs.com/shiyun32/p/11236978.html