@Emit 으로 Data 전달해주기.
232
작성한 질문수 8
혹시라도,
this.$emit('count', this.xxx);
@count=count($event)
methods: {
count(countNum){
console.log(countNum);
},
}
이런식으로 데이터를 전달하고 싶은신분이 있을까봐 예제코드 남깁니다.
@Emit('passData') // 이름이 같으면, 데코레이터에 굳이 명시해주지 않아도 된다.
public passDataToParent() {
return this.childNum++;
}
return 으로 넘기고.
v-on:passData="passDataToParent($event)"
public passDataToParent(value: number | string) {
console.log('passDataToParent..');
this.receiveMessage = value;
}
이런식으로 사용하시면 됩니다.
답변 0
소스 공유좀 해주세요
0
252
0
target null 에러뜨시는 분들
0
331
0
라우터 구조잡기 소스
0
285
0
새로 추가한 인스턴스 상태 관리
0
247
0
App.vue의 $store
0
193
0
npm run serve 에러
0
221
0
Cannot find module '@/components/message.vue' or its corresponding type declarations.
0
1152
2
prop !
0
194
0
@ MutationActions
0
179
0
mapGetters 내 정의가 안되요 ㅠ
0
260
0
안녕하세요! @Prop() readonly id(느낌표):string; 에서 !(느낌표) 를 찍는 이유가 궁금합니다 :)
0
227
0
store 사용 방법 관련 질문입니다.
0
240
1
moduleA.store.ts내에서 RootState가 하는일은 무엇인가요?
0
179
0
removeItem 에서 element 가 하나 남았을 때 삭제가 되지 않는 문제
0
373
2
Property '$route' does not exist on type 'ItemList'. 이 에러는 무엇인가요..?
0
862
1
Cannot find module '@/components/message.vue'.
0
2873
6
@Action, @Mutation 등으로 지정된 변수의 타입
0
231
1
안녕하세요. 강의 잘 들었습니다.
0
168
0
Axios Post보낼때 어떤 식으로 구성하는게 좋을까요?
0
663
1
안녕하세요! v-for(v-bind:key), slice() 관련 질문이 있어요!
2
667
3
에러 표시 질문이요!
1
403
3
vuex-module-decorators 보다 오리지널 모듈 형태를 선호하시는 이유가 무엇이신가요?
1
381
2
안녕하세요. 초기 셋팅시 질문있습니다.
1
296
2
안녕하세요! Vuex, actions 질문이 있습니다.
1
305
2





