赞
踩
1、问题如下,el-link中,如果不用prop属性,直接绑定字段不显示数据
- <div class="manifest">
- <h2 class="title">采购清单</h2>
- <el-table :data="tableData.demandPurchases" style="width: 100%">
- <el-table-column align="center" label="序号" type="index" width="60" />
- <el-table-column prop="itemName" label="物品名称" width="180" />
- <el-table-column prop="modelSpecification" label="规格型号" width="180" />
- <el-table-column prop="category" label="所属类目" />
- <el-table-column prop="quantity" label="采购数量" />
- <el-table-column prop="unit" label="计量单位" />
- <el-table-column prop="requirements" label="需求说明" />
- <el-table-column label="附件">
- <el-link target="_black" :underline="false" :href="attachmentUrl" prop="attachmentName">
- {{attachmentName}}.pdf
- </el-link>
- </el-table-column>
- </el-table>
- </div>
2、需要加一层template,设置#default="scope"
<div class="manifest">
<h2 class="title">采购清单</h2>
<el-table :data="tableData.demandPurchases" style="width: 100%">
<el-table-column align="center" label="序号" type="index" width="60" />
<el-table-column prop="itemName" label="物品名称" width="180" />
<el-table-column prop="modelSpecification" label="规格型号" width="180" />
<el-table-column prop="category" label="所属类目" />
<el-table-column prop="quantity" label="采购数量" />
<el-table-column prop="unit" label="计量单位" />
<el-table-column prop="requirements" label="需求说明" />
<el-table-column label="附件">
<template #default="scope">
<el-link target="_black" :underline="false" :href="scope.row.attachmentUrl" prop="attachmentName">
{{scope.row.attachmentName}}.pdf
</el-link>
</template>
</el-table-column>
</el-table>
</div>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。