mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
Updated example codes
This commit is contained in:
@@ -283,6 +283,8 @@ handleToggleChange(event) {
|
||||
import { getRecord } from 'lightning/uiRecordApi';
|
||||
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
|
||||
|
||||
const FIELDS = ['Account.Name', 'Account.Industry', 'Account.AnnualRevenue'];
|
||||
|
||||
export default class MyComponent extends LightningElement {
|
||||
@api recordId;
|
||||
|
||||
@@ -323,6 +325,10 @@ export default class MyComponent extends LightningElement {
|
||||
}
|
||||
}
|
||||
|
||||
performOperation() {
|
||||
// Developer-defined async operation
|
||||
}
|
||||
|
||||
showSuccessToast() {
|
||||
const event = new ShowToastEvent({
|
||||
title: 'Success',
|
||||
@@ -378,12 +384,14 @@ Prefer `lwc:if`, `lwc:elseif` and `lwc:else` for conditional rendering (API v58.
|
||||
{error.message}
|
||||
</div>
|
||||
</template>
|
||||
<template if:false={isLoading} if:false={error}>
|
||||
<template if:false={isLoading}>
|
||||
<template if:false={error}>
|
||||
<template for:each={items} for:item="item">
|
||||
<div key={item.id} class="slds-var-m-bottom_small">
|
||||
{item.name}
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user