我们在lightning开发中,quick action是一个常用的功能,很可惜的是,lwc目前还不支持单独的custom quick action操作,只能嵌套在aura中使用才能发挥作用. 官方也给我们提供了如何进行嵌套,简单代码嵌套如下所示: <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,flexipage:availableForRecordHome&quo…
本篇参考: 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…
本篇参考:https://www.lightningdesignsystem.com/components/modals/ 随着salesforce lwc的优化,越来越多的项目从aura转到了lwc开发,没有lwc的知识是不能的,但是指望lwc可以搞定所有的场景是万万不能的,比如今天的场景,quick action.目前 quick action只允许选择 Aura Component,所以我们开发 quick action基本操作是 aura 套着 lwc实现功能.那如何更好的适配UI,本篇…
本篇参考: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_quick_actions https://developer.salesforce.com/docs/component-library/bundle/lightning-quick-action-panel/documentation 背景: 我们现在项目越来越多的使用 lwc 进行了前端开发,当然我们知道lwc…
本篇参考: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/data_ui_api https://developer.salesforce.com/docs/component-library/documentation/en/lwc/data_guidelines https://developer.salesforce.com/docs/component-library/docume…
我们在上篇介绍了 @track / @api的区别.在父子 component中,针对api类型的变量,如果声明以后就只允许在parent修改,son component修改便会导致报错. sonItem.html <template> <lightning-input value={itemName} onchange={changeItemName} label="item name"></lightning-input> </templa…
本篇参看: https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation https://www.lightningdesignsystem.com/components/data-tables/ 我们在salesforce中,经常会使用 listview,标准的 lightning listview会有排序,filter展示chart等等标准功能.当然,某些情况标…
本篇参考:https://trailhead.salesforce.com/content/learn/superbadges/superbadge_lwc_specialist 我们做lwc的学习时,因为很多人可能还没接触过lwc的项目,所以通过学习知道很多的知识点,但是可能没有机会做到一个小项目,salesforce lwc superbadge正好可以在将知识点串起来基础上,深化学习,当一个小项目练手.首先先按照上方的superbadge要求,安装一个unlocked package,然后…
我们使用vs code创建lwc 时,文件会默认生成包含 template作为头的html文件,包含了 import LightningElement的 js文件以及对应的.js-meta.xml文件.前一个LWC学习的文章中已经说过当浏览器渲染的时候,遇见<template>会将其渲染成<namespace-component-name>,比如 helloWorld.html引入在页面中浏览器进行渲染时,此文件的template会被渲染成<c-hello-world>…
在Salesforce LWC学习(八) Look Up组件实现篇中,我们实现了公用的lookup组件,使用的过程中,会发现当我们输入内容以后,搜索出来的列表便无法被清空. 针对此种情况我们打算优化一下代码,针对前端的输入框,增加onblur函数,当鼠标移除情况下,设置searchTerm为空字符串并且不让下方的options展示,当鼠标移入或者输入内容情况下在展示下方的options. customLookUpForLwc.html:输入框添加onblur,下方options使用变量控制显隐…