Notes
If you write a setter for a public property, you must also write a getter. Annotate either the getter or the setter with @api, but not both. It’s a best practice to annotate the getter.
fullName.html
<template>
{uppercaseItemName}
</template>
fullName.js
import { LightningElement, api } from 'lwc';
export default class TodoItem extends LightningElement {
uppercaseItemName;
@api
get itemName() {
return this.uppercaseItemName;
}
set itemName(value) {
this.uppercaseItemName = value.toUpperCase();
}
}