阅读背景:

elementUItable二次封装

来源:互联网 

1.HTML

<template>
  <el-table
      ref="table"
      element-loading-text="Loading"
      :data="tableData"
      border 
      tooltip-effect="dark"
      style="width:100%">
      <el-table-column v-for="(item,index) in tableLabel" :width="item.width ? item.width : """ :key="index" :align="item.align" :label="item.label" :prop="item.param" :sortable="item.sortable ? "custom" : false">
        <template slot-scope="scope">
          <span v-if="item.render">
            {{item.render(scope.row)}}
          </span>
          <span v-else>{{scope.row[item.param]}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="tableOption.label" :width="tableOption.width" :label="tableOption.label" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button  v-for="(item,index) in tableOption.options" :key="index" :type="item.type" :icon="item.icon" @click="handleButton(item.methods,scope.row,scope.row)" size="mini">
            {{item.label}}
          </el-button>
        </template>
      </el-table-column>
    </el-table>
</template>
<template>
  <el-table
      ref="table



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: