Hi, Mark as best answer, If it resloves !! if you need to call lightning component in vf page, in your vf page you need to add <apex:includeLightning /> and add script in vf page and try to call component in script c:lcvfTest replace with your component name
<apex:page sidebar="false" showHeader="false"> <head> <title>Mapping</title> <apex:includeLightning /> <style> * { margin: 0; padding: 0; } </style> </head> <body> <div id="mappingDiv"> </div> <script> $Lightning.use("c:LeadpageApp", function () {//Paste you LightningApp NAme here $Lightning.createComponent( "c:LeaveComponent",//Paste your Component Name here {}, "mappingDiv",//You can change this as you want function (cmp) { } ); }); </script> </body> </apex:page>
LightningApp:-
<aura:application extends="ltng:outApp" access="global"> <!-- Allow lightning markup <aura:application attribute 'extends' to support more than one apps For eg: <aura:application access="global" extends="force:slds, ltng:outApp" > While extends support only one app, we are unable to include a lightning app in visualforce pages which extends "force:slds" --> </aura:application>
Mark as best answer, If it resloves !!
if you need to call lightning component in vf page, in your vf page you need to add <apex:includeLightning /> and add script in vf page and try to call component in script c:lcvfTest replace with your component name
check here : https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm
Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com
Please refer the below code.
your VF PAge :-
<apex:page sidebar="false" showHeader="false">
<head>
<title>Mapping</title>
<apex:includeLightning />
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="mappingDiv">
</div>
<script>
$Lightning.use("c:LeadpageApp", function () {//Paste you LightningApp NAme here
$Lightning.createComponent(
"c:LeaveComponent",//Paste your Component Name here
{},
"mappingDiv",//You can change this as you want
function (cmp) {
}
);
});
</script>
</body>
</apex:page>
LightningApp:-
<aura:application extends="ltng:outApp" access="global">
<!-- Allow lightning markup <aura:application attribute 'extends' to support more than one apps
For eg: <aura:application access="global" extends="force:slds, ltng:outApp" >
While extends support only one app, we are unable to include a lightning app in visualforce pages which extends "force:slds"
-->
</aura:application>
Please mark it as a best if it help you.
Thanks,
Ajay Dubedi