【发布时间】:2021-02-09 19:31:28
【问题描述】:
我有一个方法可以根据元素 UI 表中的列值返回一个字符串到工具提示内容,但是它只返回第一列的值,而不是在悬停后更改。
<el-table-column label="Service Lines / MSDRG" prop="code" sortable min-width="120">
<template slot-scope="slotData">
<el-tooltip
effect="dark"
placement="top-start"
:content="returnSvclinesValue(slotData.row.code , name)"
>
<span>{{ slotData.row.code }}</span>
</el-tooltip>
</template>
</el-table-column>
这里是returnSvclineValue(code, name)的方法
returnSvclinesValue: function(code, name) {
const svclinesTrimmedByName = svclines.find(i => i.label == name && i.value == name)
const svclineValue = svclinesTrimmedByName.children.find(l => l.value = code )
return svclineValue.label
}
对于returnSvclinesValue(code, name) 方法,它可以工作,我只需要它根据行的代码呈现不同的内容。有什么解决方法吗?
【问题讨论】:
标签: javascript vue.js element-ui