외부 비방출 이벤트 리스너(XXX)가 구성 요소에 전달되었지만 자동으로 전달될 수 없습니다.

Vue 프레임워크를 사용하여 상위 구성요소와 하위 구성요소 간에 값을 전송할 때 다음 경고가 나타날 수 있습니다.
Extraneous non-emits event listeners (XXX) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option. 
无关的非发出事件侦听器(XXX)被传递给组件,但不能自动继承,因为组件呈现片段或文本根节点。如果侦听器只打算作为组件自定义事件侦听器,则使用"emit "选项声明它。
XXX는 아들이 아버지에게 전달하는 맞춤 이벤트 이름입니다.
세부사항은 다음과 같습니다:여기에 이미지 설명을 삽입하세요.

이유:

https://github.com/vuejs/core/issues/2540

해결책:

이벤트를 전달해야 하는 구성 요소에 다음 코드를 추가합니다.
emits: ['XXX'] // 和props是同一级

추천

출처blog.csdn.net/Y1914960928/article/details/133136164