-
-
Save arun12209/7be22c511342f1d2360d613d3ff3869e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
//import the helper javascript module/file | |
import fetchDataHelper from './fetchDataHelper'; | |
const columns = [ | |
{ label: 'Label', fieldName: 'name' }, | |
{ label: 'Website', fieldName: 'website', type: 'url' }, | |
{ label: 'Phone', fieldName: 'phone', type: 'phone' }, | |
{ label: 'Balance', fieldName: 'amount', type: 'currency' }, | |
{ label: 'CloseAt', fieldName: 'closeAt', type: 'date' }, | |
]; | |
export default class LightningTable extends LightningElement { | |
data = []; | |
columns = columns; | |
// async-await method | |
async connectedCallback() { | |
const data = await fetchDataHelper({ amountOfRecords: 100 }); | |
this.data = data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment