강의

멘토링

커뮤니티

Inflearn Community Q&A

94883721332's profile image
94883721332

asked

Vue.js Complete Guide - Learning Practical Concepts Through Hands-on Practice and Refactoring

Showing routing components using router-view

Uncaught TypeError: Cannot read properties of undefined (reading 'use')

Written on

·

4.8K

1

라우터 연결하고

라우팅 컴포넌트 표시를하기전에 

아무것도 안나오는화면을 실행하였는데

콘솔에 해당 에러가 나옵니다.

Uncaught TypeError: Cannot read properties of undefined (reading 'use')

index.js

왜 안되는지 모르겠습니다

index부분에 export해주고

main에서 import도 해줬는데,,,,

상관은 없을거 같은데 import할때 index , index.js 둘다 해봤고요,..,

다른분도 이 에러건으로 글 올린걸 봤는데,

답변이 아직 없어서 다시 올렸습니다...................

javascriptvuejs

Answer 3

3

9488372님의 프로필 이미지
9488372
Questioner

npm install -g @vue/cli@3.8.2 로
버전 변경하고 해결했습니다.

1

안녕하세요! 
지나가는,, 사람 1 입니다 ㅎㅎ

저도 저 문제가 안되서 위에분들처럼 진행해 보았는데도 안되서 해결방안을 찾아보았습니다

npm install vue-template-compiler

사용하니 빈공백이 안나오고 바로 잘 나왔습니다 ㅠㅠ 혹여나 도움이 될까 댓글 작성합니다! :D

9488372님의 프로필 이미지
9488372
Questioner

친절하게 남겨주셔서 감사합니다 ㅠㅠ

1

captain님의 프로필 이미지
captain
Instructor

안녕하세요, CLI 버전은 최신으로 유지하셔도 됩니다. 본문에 첨부해 주신 코드는 Vue 3 기준으로 작성하셨네요. 그럼 routes/index.js의 내용이 다음과 같이 바뀌어야 해요.

export const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes: [
{
path: '/news',
component: NewsView,
},
// ...
]
})
9488372님의 프로필 이미지
9488372
Questioner

아하.. 넵 답변 감사합니다~!!!

94883721332's profile image
94883721332

asked

Ask a question