Я создал LW C для отображения учетных записей и создал один веб-компонент Lighting и один класс Apex, показанный ниже. Html файл
<template>
<lightning-card title="Showing Account(tile)">
<template if:true={successResponse}>
<template for:each={accounts} for:item="account">
<li key={account.id}>
<div class="slds-p-around_medium lgc-bg">
<lightning-tile label={account.Name} href="/path/to/somewhere">
<p class="slds-truncate" title={account.Phone}>Account's Phone Number is :
{account.Phone}
</p>
</lightning-tile>
</div>
</li>
</template>
</template>
</lightning-card>
</template>
Js .file
import { LightningElement, wire, track } from "lwc";
import allAccount from "@salesforce/apex/AcountManager.getAccount"
export default class AccountManagerApex extends LightningElement {
@wire(allAccount)
accountRecrd;
successResponse (){
if(this.accountRecrd){
return true;
}
return false;
}
}
и класс:
publi c с классом общего доступа AcountManager {
@AuraEnabled( cacheable = true)
public static List<Account> getAccount(){
return [SELECT Id,Name,Phone,Website FROM Account Limit 10];
}
}
Когда я пытаюсь выполнить развертывание в своей организации с помощью VSCode, я получаю сообщение об ошибке ниже.
Ошибка
force-app \ main \ default \ lwc \ accountManagerApex \ accountManagerApex. js МОДУЛЬ с именем разметки: // lg c: bg найдено : [markup: // c: accountManagerApex]
Может кто-нибудь сказать мне, как решить эту проблему /
Заранее спасибо,