LWC: Create a Salesforce DX Project and Lightning Web Component:https://www.youtube.com/watch?v=p268YjunARA&feature=youtu.be Build App with Package Development:https://trailhead.salesforce.com/en/content/learn/trails/sfdx_get_started Salesforce DX(De…
上一篇中我们在demo中使用了很多的 @salesforce 以及 lightning/ui*Api的方法,但是很多没有细节的展开.其实LWC中针对这些module提供了很多好用的方法,下面对这两种进行详细介绍. 一. @Salesforce @salesforce模块封装了很多的方法,用于在运行时添加相关的功能.主要方法及使用如下. 1. @salesforce/apex : 此方法用于引入apex的方法,这里的方法包括自定义的方法以及标准的预置的方法,具体操作如下.1)引入自定义apex类的…
本篇参考:https://trailhead.salesforce.com/content/learn/superbadges/superbadge_lwc_specialist 我们做lwc的学习时,因为很多人可能还没接触过lwc的项目,所以通过学习知道很多的知识点,但是可能没有机会做到一个小项目,salesforce lwc superbadge正好可以在将知识点串起来基础上,深化学习,当一个小项目练手.首先先按照上方的superbadge要求,安装一个unlocked package,然后…
本篇参考: https://developer.salesforce.com/docs/component-library/bundle/force:hasRecordId/documentation https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_record_context Salesforce LWC学习(三十六) Quick Action 支持选择 LWC了 我们在使用lwc…
本篇参考: Configure a Component for Dynamic Interactions in the Lightning App Builder - Salesforce Lightning Component Library Salesforce Help | Article GitHub - trailheadapps/dreamhouse-lwc: Sample application for Lightning Web Components on Salesforce…
在Salesforce LWC学习(八) Look Up组件实现篇中,我们实现了公用的lookup组件,使用的过程中,会发现当我们输入内容以后,搜索出来的列表便无法被清空. 针对此种情况我们打算优化一下代码,针对前端的输入框,增加onblur函数,当鼠标移除情况下,设置searchTerm为空字符串并且不让下方的options展示,当鼠标移入或者输入内容情况下在展示下方的options. customLookUpForLwc.html:输入框添加onblur,下方options使用变量控制显隐…
之前的几节都是基于前台变量进行相关的操作和学习,我们在项目中不可避免的需要获取数据以及进行DML操作.之前的内容中也有提到wire注解,今天就详细的介绍一下对数据进行查询以及DML操作以及Wire Service相关的知识. 一. LDS 学习LDS以前可以先看一下aura中LDS的概念salesforce lightning零基础学习(六)Lightning Data Service(LDS).针对LWC中的LDS和aura中的功能原理很像,区别可能是语法和标签的区别.所以这里对LDS不做过多…
本篇参考:salesforce 零基础学习(六十二)获取sObject中类型为Picklist的field values(含record type) https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_wire_adapters_picklist_values https://developer.salesforce.com/docs/component-librar…
本篇参考: https://trailhead.salesforce.com/content/learn/superbadges/superbadge_lwc_specialist https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_message_channel https://developer.salesforce.com/docs/component-library/bu…
我们使用vs code创建lwc 时,文件会默认生成包含 template作为头的html文件,包含了 import LightningElement的 js文件以及对应的.js-meta.xml文件.前一个LWC学习的文章中已经说过当浏览器渲染的时候,遇见<template>会将其渲染成<namespace-component-name>,比如 helloWorld.html引入在页面中浏览器进行渲染时,此文件的template会被渲染成<c-hello-world>…