【问题标题】:Pass value to lightning components from vf page Salesforce从 vf 页面 Salesforce 将值传递给闪电组件
【发布时间】:2018-03-21 07:37:27
【问题描述】:

从视觉力页面将值传递给闪电组件的属性。

【问题讨论】:

    标签: visualforce apex salesforce-lightning


    【解决方案1】:

    在 vf 页面中的某些函数调用下面的代码,其中 c:dependancyapp 是应用程序,c:demoComp 是组件,您需要使用dependany标签在应用程序(c:dependancyapp)中添加组件的依赖项

    dependancyapp App 下面

    <aura:application access="GLOBAL" extends="ltng:outApp"> 
    <aura:dependency resource="markup://c:demoComp" type="COMPONENT"/>
    </aura:application>
    

    js中某些动作的VF页面

     function clickMe(){
     $Lightning.use("c:dependancyapp", function() {
     $Lightning.createComponent("c:demoComp",
          { "someAttribute" : "attribute value"},
            "lightning",
             function(cmp) {
                // do some stuff
           });
       });
      }
      
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多