반응형
알 수 없는 사용자 지정 요소 - 구성 요소를 올바르게 등록했습니까?
현재 vuejs 2에서 웹 팩을 사용하고 있습니다.매우 기본적인 컴포넌트 [Main]가 있습니다.vue]는 vue-router에 의해 렌더링되며, 이 컴포넌트 내에 다른 [Information.vue]가 필요합니다.웬일인지 제대로 렌더링할 수가 없어요.
컴포넌트/테스트/정보.표시하다
<template>
<div>
TEST
</div>
</template>
<script>
export default {
name: 'information',
props: {
bleh: {
type: Object,
required: true
}
}
}
</script>
컴포넌트 / 테스트 / 테스트 / 컴포넌트 / 컴포넌트.
export { default as Main } from './Main'
export { default as Information } from './Information'
컴포넌트/테스트/메인표시하다
<template>
<information :bleh="{}" />
</template>
<script>
import { Information } from 'components/test'
export default {
name: 'main',
components: { Information }
}
</script>
왜 다음 오류가 발생하는지 아십니까?
[Vue warn]: Unknown custom element: <information> - did you register
the component correctly? For recursive components, make sure to
provide the "name" option
이것은 매우 오래된 질문이지만, 향후의 방문자에게 도움이 될 수 있도록 대답합니다.
사용자 지정 요소는 자동으로 닫히지 않아야 합니다.
<information :bleh="{}" />
반드시 다음과 같이 사용해 주세요.
<information :bleh="{}"></information>
또한 공식 웹 컴포넌트를 준수하려면 다음과 같은 점선 태그를 사용하십시오.
<information-component ...></information-component>
다음과 같은 오류가 발생한 경우:
컴포넌트를 올바르게 등록했습니까?
구성 요소를 직접 등록해 보십시오.이걸로 고쳤어요.
Vue.component('Information', Information)
언급URL : https://stackoverflow.com/questions/43378354/unknown-custom-element-did-you-register-the-component-correctly
반응형
'source' 카테고리의 다른 글
Enter 키를 누르면 vuejs의 버튼을 클릭합니다. (0) | 2022.08.14 |
---|---|
vue2의 별칭 URL에서 ID 가져오기 (0) | 2022.08.14 |
클릭 시 Vue 목록 항목 (0) | 2022.08.13 |
vue-cli 로더가 webpack-loader에 대한 기본 init에서 작동하지 않음 (0) | 2022.08.13 |
항상 true를 반환하는 기본 제공 Java 8 술어? (0) | 2022.08.13 |