I would like to have a dynamic CSS where the font color get red if the data exist;
I am using a loop function in my HTML in the following way:
<template if:true={fulldata}>
<template for:each = {fulldata} for:item = "item" for:index="indexVar">
<tr key={item.key} class="slds-hint-parent">
<td class="slds-size_4-of-12" data-label="Prospecting" scope="row">
<div class="lineReturn" title={item.name}>
<div>{item.name}</div>
</div>
</td>
<td class="slds-size_3-of-12" data-label="Prospecting" scope="row">
<div class="lineReturn" title={item.Value}>
<lightning-formatted-number value={item.Value} maximum-fraction-digits="0"></lightning-formatted-number>
</div>
</td>
<td class="slds-size_1-of-12" data-label="Prospecting" scope="row">
<div class="lineReturn" title={item.coeff}>
<template if:false={isEdited}>
<div class={changedData_css}>{item.coeff}</div>
</template>
<template if:true={isEdited}>
<lightning-input type="number" key={item.coeff} data-id={item.coeff} name={item.fields} label="Name" variant="label-hidden" onchange={handleChange} disabled={item.disabled}></lightning-input>
</template>
</div>
</td>
</tr>
</template>
</template>
I would like to check with the changeddata_css if recordData[item.name] exist then return RedFont which is the name of my css class.
how can I pass a parameter into a get fonction ? such as
get changedData_css(item.name){
if(this.recordData.item.name){
return 'redFont'
}
}
thxc you