Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1008 Bytes

README.md

File metadata and controls

47 lines (37 loc) · 1008 Bytes

lwc-lookup

An SObject Generic Lookup component built with LWCs.

License

BSD3 License

demo

Usage

<template>
  <div class="slds-m-around_large">
    <div class="slds-grid slds-gutters slds-wrap">
      <div class="slds-col slds-size_1-of-3 slds-p-top_medium">
        <lightning-card title="Account Lookup">
          <div class="slds-p-horizontal_medium">
            <c-lookup sobject-name="Account"
              title="Name"
              subtitle="Phone"
              onselected={handleAccountLookup}
              icon-name="standard:account"></c-lookup>
          </div>
          <div slot="footer">
            Account Id: {accountId}
          </div>
        </lightning-card>
      </div>
    </div>
  </div>
</template>
import { LightningElement, track } from 'lwc'

export default class MyComponent extends LightningElement {
  @track accountId

  handleAccountLookup (event) {
    this.accountId = event.detail
  }
}