I know that we can't write a specific condition in <template if:true={specificcondition}>
LWC HTML file.
However what is the best way to implement next HTML code :
<template for:each={accounts} for:item="account">
<template if:true="{account.Payment_Status__c = "Completed" }">
<!-- some HTML code -->
</template>
<template if:true="{account.Payment_Status__c = "Not Received" }">
<!-- some HTML code -->
</template>
<template if:true="{account.Payment_Status__c = "Blank" }">
<!-- some HTML code -->
</template>
</template>
JS file :
@wire(getAccountList)
setAccountList({ data, error }) {
if (data) {
this.accounts = data;
} else if (error) {
console.error(error);
}
}
I know that the above code will not work.
But what is the best way to get the working approach for this ?