3

I have a child component folder "bCPContractTOP" which has

  1. bCPContractTOP.HTML
  2. bCPContractTOP.js
  3. bCPContractTOP.js-meta.xml

How to call this from parent component. I am getting one error

LWC1010: Failed to resolve entry for module "bCPContractTOP".

<template>
  <div>
    <lightning-input type="text" value={checknameinputvalue} name="CheckName" label="Check Name" required onchange={handleInputChange}></lightning-input>
    <lightning-button label="Generate" title="Generate" class="slds-m-left_x-small" onclick={handleClick} ></lightning-button>
    <c-bCPContractTOP check-name={checkNameValue}></c-bCPContractTOP>
  </div>
</template>
7

Capital letters become lowercased and prefixed with a hyphen (-), so the name would become:

c-b-c-p-contract-t-o-p

Your code would look like this:

<c-b-c-p-contract-t-o-p check-name={checkNameValue}></c-b-c-p-contract-t-o-p>

This is called "kebab case" in the documentation.

For this reason, it's probably more beneficial to not use so many capital letters in your component name.

Also, the file names are case sensitive--make sure your template is bCPContractTOP.html (lowercase html).

1
  • Worth noting that numbers get a hyphen prefix too. (Not sure if each digit gets one, or just the first digit in a number sequence; didn't think to try that one out before.) – Phil W May 31 '19 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.