父组件:
el-table组件内:
<template> <el-table class="em_table" :data="tableData" stripe :border="true" :size="size"> <el-table-column v-for=" (column,index) in columns " :key="index" :prop="column.prop " :label="column.label "> <template slot-scope="scope"> <span v-if="column.label !== ‘Area‘">{{formatCurrency(scope.row[column.prop])}}</span> <span v-else>{{scope.row[column.prop]}}</span> </template> </el-table-column> </el-table> </template>
原文:https://www.cnblogs.com/listen9436/p/12012880.html