function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JaanuJaanu 

The 'title' property does not exist on the component Error?

If user clicks on the case no. in community page, the details needs to be displayed in community layout. Developing Lightning Web Component for this to display the case details (few fields only). I have html file and xml files ready. When trying to save the .js file, I am getting the below error msg. Can someone help me on this.. new to this. 
I am following the link by @RajVakati  (Displaying Record Fields section)
https://rajvakati.com/lightning-web-components/

The 'title' property does not exist on the component Error

<template>
    <lightning-record-view-form
                record-id={recordId}
                object-api-name="case">
        <div class="slds-grid slds-gutters">
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='CaseNumber'></lightning-output-field>
            </div>
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='Origin'></lightning-output-field>
            </div>


import { LightningElement ,api} from 'lwc';
 
export default class Recordview extends LightningElement {
    @api recordId ;
}
           
        </div>
    </lightning-record-view-form>
</template>




 
Best Answer chosen by Jaanu
Abdul KhatriAbdul Khatri
Not sure why you js file is embedded in html. May be copy and paste error. So you should have 2 files like this
.html file
<template>
    <lightning-record-view-form
                record-id={recordId}
                object-api-name="case">
        <div class="slds-grid slds-gutters">
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='CaseNumber'></lightning-output-field>
            </div>
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='Origin'></lightning-output-field>
            </div>   
        </div>
    </lightning-record-view-form>
</template>
.js file
import { LightningElement, api } from 'lwc';

export default class Devforumsol extends LightningElement {

    @api recordId ;
}
Here is what you need to do
User-added image

 

All Answers

Abdul KhatriAbdul Khatri
Not sure why you js file is embedded in html. May be copy and paste error. So you should have 2 files like this
.html file
<template>
    <lightning-record-view-form
                record-id={recordId}
                object-api-name="case">
        <div class="slds-grid slds-gutters">
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='CaseNumber'></lightning-output-field>
            </div>
            <div class="slds-col slds-size_1-of-2">
                <lightning-output-field field-name='Origin'></lightning-output-field>
            </div>   
        </div>
    </lightning-record-view-form>
</template>
.js file
import { LightningElement, api } from 'lwc';

export default class Devforumsol extends LightningElement {

    @api recordId ;
}
Here is what you need to do
User-added image

 
This was selected as the best answer
JaanuJaanu
Thanks so much Abdul.