LoginSignup
1
0

More than 5 years have passed since last update.

Lightning Web Components HelloWorld

Posted at

The original page link

Lightning Web Components HelloWorld

Topic

In this project, you’ll:

Config Salesforcexytools

How to Config Salesforcexytools.

Please set your api 45.0

1545965650321

Create a Hello World Lightning Web Component

create a Lightning web component.

The Source is From Create a Hello World Lightning Web Component

Create source in sublime, like below:

1545964554803

helloWorld.html

<template>
    <lightning-card title="HelloWorld" icon-name="custom:custom14">
        <div class="slds-m-around_medium">
            <p>Hello, {greeting}!</p>
            <lightning-input label="Name" value={greeting} onchange={changeHandler}></lightning-input>
        </div>
    </lightning-card>
</template>

helloWorld.js

import { LightningElement, track } from 'lwc';
export default class HelloWorld extends LightningElement {
    @track greeting = 'World';
    changeHandler(event) {
        this.greeting = event.target.value;
    }
}

helloWorld.js-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

Deploy a Lightning web component

Right Click -> Deploy Directory To Server

1545965045120

Select Deploy Direcotry

1545965073324

Click Yes!

1545965134397

Check the log

1545965313466

Add Component to App in Lightning Experience

Please read Create a Hello World Lightning Web Component

Resources

Introducing Lightning Web Components

Quick Start: Lightning Web Components

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0