methods:{ dictByItem: function(item, row) { let dictElement = this.dict[item.dictName]; let filter = dictElement.filter(i => i.value === row[item.prop] + ''); return filter && filter.length > [0] ? filter[0].label : ''; }, functionByName: function(funcName,value){ return this.$parent.$options.methods[funcName](value); } }
<template v-else-if="item.type && item.type === 'func'"> <el-table-column :label="item.label" :prop="item.prop" v-bind="item.attr" > <template slot-scope="scope"> <div>{{ functionByName(item.funcName,scope.row[item.prop])}}</div> </template> </el-table-column> </template>
标签:调用,funcName,filter,item,vue2,方法,row From: https://www.cnblogs.com/qq376324789/p/18675570