Die UI-Tabellendaten 0 und 1 des Vue-Elements werden in Ob konvertiert

1. Fügen Sie vue hinzu: formatter="formatFreeShippingInfo"

<el-table-column
  :formatter="formatFreeShippingInfo"
  prop="isFreeShipping"
  label="是否包邮"
  width="40"
</el-table-column>

2. Schreiben Sie die Methode formatFreeShippingInfo() in Methoden:{}

methods:{
    
    

	formatFreeShippingInfo(row, column){
    
    //是否包邮 信息转换为是否
      return row.isFreeShipping == '1' ? "是" : row.isFreeShipping == 	'2' ? "否" : "未作备注";
    },

}

Supongo que te gusta

Origin blog.csdn.net/weixin_42692989/article/details/123594900
Recomendado
Clasificación