작성
·
210
1
혹시라도,
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;
}
이런식으로 사용하시면 됩니다.
답변