Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers
A. $Lightning.createComponent
B. < apex:slds > < /apex:slds>
C. $Lightning.useComponent
D. $Lightning.use
E. < apex : includeLightning / >
A. $Lightning.createComponent D. $Lightning.use E. < apex : includeLightning / >
Explanation:
To embed a Lightning component on a Visualforce page, Salesforce provides the $Lightning global object and some required Visualforce tags.
A. $Lightning.createComponent
Used to dynamically create and insert the Lightning component into the Visualforce page.
D. $Lightning.use
Initializes the Lightning runtime and specifies which Lightning component bundle to use. It's required before calling createComponent.
E.
This tag loads the Lightning runtime into the Visualforce page—necessary to support $Lightning.
Incorrect Options:
B. < apex : slds >
This is used to include SLDS styles, not required to embed a Lightning component.
C. $Lightning.useComponent
Not a real method — invalid in the Lightning global object.