el-table 单元格增加下划线和单击事件

 <el-table-column align="center" type="selection" width="50" />
      <el-table-column
        v-for="column in columns"
        :key="column.prop"
        :show-overflow-tooltip="true"
        header-align="center"
        align="center"
        :prop="column.prop"
        :label="column.label"
        :width="column.width"
        :min-width="column.minWidth"
        :fixed="column.fixed"
        :type="column.type"
        :formatter="column.formatter"
        :sortable="column.sortable==null?true:column.sortable"
      >
        <!-- :sortable="column.sortable==null?true:column.sortable" -->
        <template slot-scope="scope">
          <span v-if="column.options && column.options.length">{{ matchEnumVal(scope.row[column.prop], column.options) }}</span>
          <span v-else-if="column.prop === 'address'">
            <div style="color:red;text-decoration:underline;cursor:pointer;" @click="handleSeeInfo(scope.$index, scope.row)">
            {{scope.row.address }}
           </div></span>
          <span v-else-if="column.prop === 'enableStatus'">{{ scope.row.enableStatus?'启用':'停用' }}</span>
          <span v-else-if="column.prop == 'genMethod'">{{ scope.row.genMethod ==='system' ?'是':'否' }}</span>
          <span v-else>{{ scope.row[column.prop] === true ? '是' : ( scope.row[column.prop] === false ? '否' : scope.row[column.prop]) }}</span>

          <!-- <span
            v-else-if="scope.row[column.prop] === true"
          >{{ scope.row.genMethod ==='system' ?'是':'否' }}</span> -->
        </template>
      </el-table-column>

 

posted @ 2020-02-26 14:49  夏天的西瓜君  阅读(2830)  评论(0编辑  收藏  举报