@Emit 으로 Data 전달해주기.
238
작성한 질문수 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
263
0
target null 에러뜨시는 분들
0
342
0
라우터 구조잡기 소스
0
302
0
새로 추가한 인스턴스 상태 관리
0
266
0
App.vue의 $store
0
204
0
npm run serve 에러
0
237
0
Cannot find module '@/components/message.vue' or its corresponding type declarations.
0
1169
2
prop !
0
207
0
@ MutationActions
0
185
0
mapGetters 내 정의가 안되요 ㅠ
0
271
0
안녕하세요! @Prop() readonly id(느낌표):string; 에서 !(느낌표) 를 찍는 이유가 궁금합니다 :)
0
241
0
store 사용 방법 관련 질문입니다.
0
265
1
moduleA.store.ts내에서 RootState가 하는일은 무엇인가요?
0
192
0
removeItem 에서 element 가 하나 남았을 때 삭제가 되지 않는 문제
0
404
2
Property '$route' does not exist on type 'ItemList'. 이 에러는 무엇인가요..?
0
881
1
Cannot find module '@/components/message.vue'.
0
2924
6
@Action, @Mutation 등으로 지정된 변수의 타입
0
243
1
안녕하세요. 강의 잘 들었습니다.
0
179
0
Axios Post보낼때 어떤 식으로 구성하는게 좋을까요?
0
686
1
안녕하세요! v-for(v-bind:key), slice() 관련 질문이 있어요!
2
697
3
에러 표시 질문이요!
1
434
3
vuex-module-decorators 보다 오리지널 모듈 형태를 선호하시는 이유가 무엇이신가요?
1
397
2
안녕하세요. 초기 셋팅시 질문있습니다.
1
325
2
안녕하세요! Vuex, actions 질문이 있습니다.
1
325
2





