Skip to main content

Challenge not yet complete in Empathetic Unicorn Playground

We can't find 'lightning-input' in accountFinder.html.

accountFinder.html.

<template>

    <lightning-card>

        <lightning-input

            type="number"

            label="Annual Revenue"

            value={annualRevenue}

            onchange={handleChange}>

        </lightning-input>

        <lightning-button

            label="Reset"

            onclick={reset}>

        </lightning-button>

    </lightning-card>

  </template>

accountFinder.js

import { LightningElement } from 'lwc';

export default class AccountSearch extends LightningElement {

    annualRevenue = null;

    handleChange(event) {

        this.annualRevenue = event.detail.value;

    }

    reset() {

        this.annualRevenue = null;

    }

}

 

xml 

 

<?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>48.0</apiVersion>

    <isExposed>true</isExposed>

    <targets>

        <target>lightning__AppPage</target>

    </targets>

</LightningComponentBundle>

2 件の回答
  1. 2024年1月22日 8:08

    Thanks every body its solved after performed following change 

    <template>

        <lightning-card>

            <lightning-input

                type="number"

                label="Annual Revenue"

                formatter="currency"<!--<<<<<----------------------Added ----->>>>>>

                value={annualRevenue}

                onchange={handleChange}>

            </lightning-input>

            <lightning-button

                label="Reset"

                onclick={reset}>

            </lightning-button>

        </lightning-card>

      </template>

0/9000