Activity Forums Salesforce® Discussions How to use a lightning component in a visualforce page in salesorce ?

  • Nikita

    Member
    August 28, 2019 at 5:47 am

    Hi Hariom,

    There are three steps to add Aura components to a Visualforce page.

    • Add the Lightning Components for Visualforce JavaScript library to your Visualforce page using the <apex:includeLightning/> component.
    • Create and reference a Lightning app that declares your component dependencies.
    • Write a JavaScript function that creates the component on the page using $Lightning.createComponent().
  • Saddam

    Member
    August 29, 2019 at 6:22 am

    Hi Hariom,

    First of all, you need to extends="ltng:outApp" in your lightning app,

    after that you can follow this step:

    1.Add the <apex:includeLightning /> component to your Visualforce page.
    2. Reference a Lightning app that declares your component dependencies with $Lightning.use().
    3. Write a function that creates the component on the visualforce page with $Lightning.createComponent().

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos