项目场景:
相关背景:
vue 项目中 使用vxe-grid 表格中给表格的表头设置特殊的格式,并为指定的列文字设置颜色
实现方案:
具体实现方法及步骤:
一、给表格的表头设置特殊的格式

 实现方式一:
   :header-row-style="{'background-color': '#ffffff','color':'#7a8794'}"
 
实现方式二:
   :header-row-style="tableHeaderColor"
// 调用方法
tableHeaderColor({row , column , rowIndex , columnIndex}){
      if(columnIndex === 1) {
        return 'color: #0a8cea'; //  给该表头设置为蓝色
      }
      return 'color: #000'; // 默认颜色
    },
 
二、给表格的表头设置特殊的格式

步骤一:
 添加属性::cell-style=“cell” ,调用 cell 方法
步骤二:
 method里声明 cell 方法
cell({row , column , rowIndex , columnIndex}){
 if(columnIndex === 1) {
 return ‘color: #0a8cea’; // 给指定列设置蓝色
 }
 return ‘color: #000’; // 默认颜色
 },


















