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