qqw

abcd·2024년 10월 17일

test22

목록 보기
4/6

import { LightningElement } from 'lwc';
import testString from '@salesforce/apex/dataWapperTestApex.zzabc';

export default class DataWarppertest extends LightningElement {
abc() {
testString({ abcd: 'bbbb' })
.then(result => {
console.log('Result from Apex:', result);
})
.catch(error => {
console.error('Error from Apex:', error);
});
}
}
/**

  • @description :

  • @author : ChangeMeIn@UserSettingsUnder.SFDoc

  • @group :

  • @last modified on : 10-17-2024

  • @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
    **/
    public with sharing class dataWapperTestApex {
    @AuraEnabled(cacheable=true)
    public static String zzabc(String abcd) {
    // DataWrapper 클래스의 인스턴스를 생성하고, 적절한 값을 반환
    DataWrapper wrapper = new DataWrapper(abcd);
    return wrapper.label; // 예를 들어 label 필드를 반환
    }

    public class DataWrapper {
        @AuraEnabled
        public String label { get; set; }
    
        public DataWrapper(String label) {
            this.label = label;
        }
    }

    }

0개의 댓글