Skip to main content
i found that i cant use @wire without setting cacheable=true.  But i dont want to cache the data... is there any solution?
답변 2개
  1. 2019년 12월 29일 오후 3:33

    In javascript file.

    import connectToMethod from '@salesforce/apex/lwcController.methodToCall'

    @wire(connectToMethod, {recordId: '$recordId'})

    wiredData({error, data}){

    if( data ) {

    //Data handle

    }else{

    //Error handle

    }

    }

    In apex lwcController.cls create the method:

    @AuraEnabled

    public static Object methodToCall(String recordId){

    //Code

    }

     
0/9000