Coding-Study/Vue.js
[Vue.js][Error] Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead. 해결
jainn
2021. 11. 11. 14:20
728x90
개발자 도구에
Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
라는 에러가 떴다.
알고보니 root를 하나로 설정해야 하는 규칙을 위배해서 생기는 에러이다.
따라서 Template 바로 아래에 <div></div> 태그를 추가해 감싸주면 된다.
반응형