Salesforce Fact #939 | LWC bind HTML classes
From LWC api version 62.0 onwards, we can manipulate an element or component's class list by using the class attribute.
Instead of doing string concatenation, we can return an object or array for complex class names using a getter. It will eventually be rendered as a space separated string of class names.
Reference: https://developer.salesforce.com/docs/platform/lwc/guide/create-components-class-binding.html
Attached are the screenshots.
Comments
Post a Comment