emit1 emit 흐름구조 emit는 상급vue에게 하급vue event를 넘겨준다. 1. html에 이벤트를 만들어 준다. {{ myMessage }} 뀨 //3번 2. 이벤트에 맞는 function을 만들어준다. data: function() { return { childInputData: '' // 이부분 } 3. 이벤트에 맞는 method를 맞춰 만들어준다. methods: { childInputChange: function() { console.log('child!', this.childInputData) // 부모 컴포넌에게 1번인자 라는 이벤트를 발생 + 2번인자부터 데이터를 보냄 this.$emit('child-input-change',this.childInputData) // this.$emit으로 보낼 이벤트명과.. 2022. 5. 11. 이전 1 다음