Lightning component

Lightning Component ライブラリーが変わってる!

えっ? なに、Playgroundってそんなのあったけ? って思ったらLightning Web Componentが追加されてた! 何があるかな!上からみてみよー!

コンポーネントのアイコンを設定しよう

こんな編集ページでよく表示されてるコンポーネントの雷マークを 梅干しに変えられる。 1. SVGファイルを生成 2. ソース修正 ①タグを消して下記のタグを入れる <image x="0" y="0" width="120px" height="120px" xlink:href="data:image/png;base64,(ここよ)"/> ②(ここよ)のところにイメージをbase64でencodeしたテキストを入れる base64でencodeするサイト </image>…

JSを書かずに一致チェックができる!

emailInput.cmp <aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:attribute name="email" type="String"/> <lightning:input type="email" label="メールアドレス" name="email" value="{!v.email}" /> </lightning:input></aura:attribute></aura:component>

<lightning:input type="email"..>の入力チェックがちょっと足りないなと思った

①カスタム項目(メール) ②コンポーネント <lightning:input type="email" label="Email" name="email" value="abc@domain.com" /> ③コンポーネント </lightning:input>

探んてみよう!日付、時間、日付/時間タイプ

Test_DateTime.cmp <aura:component implements="lightning:actionOverride,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" controller="DateTimeController" access="global"> </aura:component>

component.cmpでどう書けばその値表示されるの?(collection type調査)

controller.jsとcomponent.cmpで表現が違うときがあって調査して見た。 developer.salesforce.com <aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > </aura:component>

コンポーネントが表示されない

値がnullではなかったらのif文は

値がnullではなかったらのif文は こんな書き方ができる! if (myRecord) { } const myRecord = response.getReturnValue(); if (myRecord) { //now process the record }下記の奴らはfalseになるから false (of course) 0 (the number zero) "" or '' (an em…

「===」、「 !==」 を使おう!

X false == ""; // true false == "0"; // true "" == "0"; // false [0] == 0; // true O false === ""; // false false === "0"; // false "" === "0"; // false [0] === 0; // falsetrailhead.salesforce.com