Vue element-UI在表格中使用prop属性的方法

这里遇到一个需求实在表格中使用图片展示活动的头像
一开始使用el-table来做表格每一个分列都是使用prop属性来作为这个表格中的字段,但是在image当中你需要将字段作为image的src来使用因此使用了插件里面套用scope然后使用scope属性的办法来实现

//Vue Element-UI
<el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
      <el-table-column align="center" type="selection" width="60">
      </el-table-column>
      <el-table-column sortable prop="id" label="序号" width="110">
      </el-table-column>
      <el-table-column sortable prop="image" label="图片" width="100">
        <template slot-scope="scope">
          <el-image :src="scope.row.image"></el-image>
        </template>
      </el-table-column>
      <el-table-column sortable prop="name" label="发起者昵称" width="200">
      </el-table-column>
      <el-table-column sortable prop="originator_id" label="发起者id" width="100">
      </el-table-column>
      <el-table-column align="center" label="操作" min-width="300">
        <template slot-scope="scope">
          <el-button size="mini" type="warning" @click="jump(scope.row.id)">查看</el-button>
          <el-button size="mini"  type="success" @click="acceptActivity(scope.$index, scope.row.id)">同意</el-button>
          <el-button size="mini" type="danger" @click="refuseActivity(scope.$index, scope.row.id)">拒绝</el-button>
        </template>
      </el-table-column>
    </el-table>
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值