How to use the lightning-formatted-email, lightning-formatted-number, lightning-formatted-phone, lightning-formatted-date-time, lightning-formatted-text, lightning-formatted-address, lightning-formatted-url in Salesforce lightning web component (LWC) #63
Step 1:- Create Lightning Web Component HTML ➡ lwcFormattedInput.html
`
Create Formatted Email, Formatted Number, Formatted Phone, Formatted date-time, Formatted Time, Formatted Text, Formatted Address and Formatted Url in Lightning Web Component (LWC)
Formatted Email
Formatted Number
Formatted Phone
Formatted date-time
Formatted Time
Simple Time value:
Time value with Z suffix:
Formatted Text
Formatted Address
Formatted Address in Plain Text
Formatted Url
Absolute URLs are created if the value doesn't begin with /
Relative URLs are created if the value begins with /
Only http, https, and ftp protocols are supported.
`
Step 2:- Create Lightning Web Component Javascript ➡ lwcFormattedInput.js
import { LightningElement } from 'lwc'; export default class LwcFormattedInput extends LightningElement { }
Step 3:- Create Lightning Web Component Meta XML ➡ lwcFormattedInput.js-meta.xml
` <?xml version="1.0" encoding="UTF-8"?>
45.0truelightning__AppPagelightning__RecordPagelightning__HomePage`
**[→ Get source code live demo link:-](https://www.w3web.net/use-the-lightning-formatted-fields-in-lwc/)**
In this post we are going to learn about How to use the lightning-formatted-email, lightning-formatted-number, lightning-formatted-phone, lightning-formatted-date-time, lightning-formatted-text, lightning-formatted-address, lightning-formatted-url in Salesforce lightning web component (LWC).
→ Get source code live demo link:-
Step 1:- Create Lightning Web Component HTML ➡ lwcFormattedInput.html
`
Formatted Email
Formatted Number
Formatted Phone
Formatted date-time
Formatted Time
Simple Time value:
Time value with Z suffix:
Formatted Text
Formatted Address
Formatted Address in Plain Text
Formatted Url
Absolute URLs are created if the value doesn't begin with /
Relative URLs are created if the value begins with /
Only http, https, and ftp protocols are supported.
`
Step 2:- Create Lightning Web Component Javascript ➡ lwcFormattedInput.js
import { LightningElement } from 'lwc'; export default class LwcFormattedInput extends LightningElement { }
Step 3:- Create Lightning Web Component Meta XML ➡ lwcFormattedInput.js-meta.xml
` <?xml version="1.0" encoding="UTF-8"?>