Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- React
- 그대로 출력하기
- await
- 백준 11718
- getline
- 값삭제
- plot in r
- 이용현황분석
- 백준
- asynchronization
- vetor
- barplot
- 10172
- 값추가
- setstate
- 그래픽
- 배열추가
- R 그래프
- 이스케이프시퀀스
- barplot in r
- 백준 10172
- react #회원가입 #비밀번호비교
- DataFrame
- 탈출문자
- 배열삭제
- useState
- 광명시버스분석
- 버스분석
- R데이터형태
- 데이터분석
Archives
- Today
- Total
devlog_zz
vue Study - event bus 본문
728x90
event bus : 루트 컴포넌트를 거치지 않고 자식컴포넌트끼리 이벤트를 주고 받아 데이터를 변경할 수 있다.
main.js
export const bus = new Vue(); //새로운 객체 생성 - footer와 header에서 사용 |
Header.vue, footer.vue
import { bus } from '../main'; |
Header.vue
this.title='Vue Wizards'; bus.$emit('titleChanged','Vue Wizards'); |
Footer.vue
created(){ bus.$on('titleChanged',(data)=>{ this.title=data; }) } |
728x90
'Front End > Vue' 카테고리의 다른 글
vue study - slot (0) | 2020.03.26 |
---|---|
vue study - life cycle hooks (0) | 2020.03.26 |
vue Study - event (child to Parent) (0) | 2020.03.26 |
vue study - primitive type vs reference type (0) | 2020.03.26 |
vue study - props (0) | 2020.03.25 |
Comments