Open vijayk3327 opened 1 year ago
in this post we are going to learn about How to create lightning-pill button with remove dynamically functionality in LWC Salesforce .
→ Get source code live demo link:-
Step 1:- Create Lightning Web Component HTML ➡ lwcPills.html
`
Don't forget to check out:-An easy way to learn step-by-step online free Salesforce tutorial, To know more Click Here..
You May Also Like →
Step 2:- Create Lightning Web Component Javascript ➡ lwcPills.js
` import { LightningElement, track, api } from 'lwc';
export default class LwcPills extends LightningElement {
@track labelItems = [ { label: 'Salesforce LWC' }, { label: 'Aura Lightning' }, { label: 'Integration' }, { label: 'W3web Tutorial' } ]; removePillItem(event) { const pillIndex = event.detail.index ? event.detail.index : event.detail.name; const itempill = this.labelItems; itempill.splice(pillIndex, 1); this.labelItems = [...itempill]; console.log(pillIndex, this.labelItems); }
}`
Step 3:- Create Lightning Web Component Meta XML ➡ lwcPills.js-meta.xml
` <?xml version="1.0" encoding="UTF-8"?>
in this post we are going to learn about How to create lightning-pill button with remove dynamically functionality in LWC Salesforce .
→ Get source code live demo link:-
Step 1:- Create Lightning Web Component HTML ➡ lwcPills.html
`
Don't forget to check out:-An easy way to learn step-by-step online free Salesforce tutorial, To know more Click Here..
You May Also Like →
`
Step 2:- Create Lightning Web Component Javascript ➡ lwcPills.js
` import { LightningElement, track, api } from 'lwc';
export default class LwcPills extends LightningElement {
}`
Step 3:- Create Lightning Web Component Meta XML ➡ lwcPills.js-meta.xml
` <?xml version="1.0" encoding="UTF-8"?>