LWC (Lightning Web Component) in Salesforce
LWC Definition
- Lightning Web Components (LWC) is a stack of modern lightweight frameworks built on the latest web standards.
- Lightning web components are custom HTML elements built using HTML and modern JavaScript.
LWC Setup: Install VS code & SFDX CLI
- Download and Install SFDX CU from https://developer.salesforce.com/tools/sfdxcli
- Download and Install MS Visual Code from https://code.visualstudio.com/
- Open Visual Code and Install Salesforce Extension Pack.
Create a Project
- Open Visual Studio Code.
- Press Ctrl + Shift + P on Windows then type create project. Select SFDX: Create Project, and press Enter.
- Leave the default project type selection Standard as is, and press Enter.
- Enter LWC_Project as project name, and press Enter. Choose a directory on your local machine where the project will be stored. Click Create Project.
Authorize Your Dev Hub
- Press Ctrl +Shift+ Pon Windows Type sfdx and Select SFDX: Authorize an Org.
- Log in using your Dev Hub org credentials. and Click Allow.
Create a Lightning Web Component
- Open Visual Studio Code.
- Press Ctrl +Shift+ P on Windows then type Create Lightning Web Component. Press Enter.
- Enter the Name "dec_firstcomponent" Press Enter.
- Press Enter to accept the default project folder.
LWC Bundle consist of 4 Elements:
- Component HTML File
- Component JavaScript File
- Component Configuration File
- Component CSS File
Lightning Component useful Links
Component Library :https://developer.salesforce.com/docs/component-library/bundle/lightning-modal/documentation
LDS:https://www.lightningdesignsystem.com/components/textarea/#Required
Lightning Studio: https://chromewebstore.google.com/detail/lightning-studio/ehkpneicmpbdejpoancidgkejlkahjgo
إرسال تعليق