用于getRecord方法,在控制台上抛出错误,有什么解决办法吗?这是我的代码,我需要修改代码。
控制台上抛出错误(图片)
import { LightningElement, track, api,wire } from 'lwc';
import { getRecord,getFieldValue } from 'lightning/uiRecordApi';
@api recordId;
@track LjobsValue;
@track CjobsValue;
@track MjobsValue;
@wire(getRecord, { recordId: '$recordId', layoutTypes: ['Full'], modes: ['View'] })
wiredRecord({data,error}) {
if (data) {
var result = JSON.parse(JSON.stringify(data));
this.LjobsValue=getFieldValue(data,'Loan__c.Total_Jobs_Lost__c');
this.MjobsValue=getFieldValue(data,'Loan__c.Total_Jobs_Maintained__c');
this.CjobsValue=getFieldValue(data,'Loan__c.Total_Jobs_Created__c');
}
else{
this.error=error;
console.log(error);
}
}