0

LWC スーパーバッジのステップ 14 で、次のエラーが表示されます。適切な大文字と小文字の区別と一貫した引用を使用して、relatedBoats、boatId、similarBy の適切な値を含め、コンポーネントが要件に従って作成されていることを確認してください。以下は私のファイルのJSコードです。誰かが私のコードで何が間違っているか教えてもらえますか?? 私はこれで24時間以上立ち往生しています。

    import { LightningElement, api, wire } from 'lwc';
import getSimilarBoats from '@salesforce/apex/BoatDataService.getSimilarBoats';
import { NavigationMixin } from 'lightning/navigation'
export default class SimilarBoats extends NavigationMixin(LightningElement) {

    @api similarBy;
    relatedBoats;
    boatId;
    error;

    // public
    @api
    get recordId() {
        return this.boatId;
    }
    set recordId(value) {
        // sets the boatId value
        this.boatId = value;
        // sets the boatId attribute
    }

    @wire(getSimilarBoats, { boatId: this.boatId, similarBy: '$similarBy' })
    similarBoats({ error, data }) {
        if (data) {
            this.relatedBoats = data;
            this.error = undefined;
        } else if (error) {
            this.relatedBoats = undefined;
            this.error = error;
        }
    }
    get getTitle() {
        return 'Similar boats by ' + this.similarBy;
    }
    get noBoats() {
        return !(this.relatedBoats && this.relatedBoats.length > 0);
    }

    // Navigate to record page
    openBoatDetailPage(event) {
        this[NavigationMixin.Navigate]({
            type: 'standard__recordPage',
            attributes: {
                recordId: this.boatId,
                objectApiName: BOAT_OBJECT,
                actionName: 'view'
            },
        });
    }

}
4

2 に答える 2