강의

멘토링

커뮤니티

Inflearn Community Q&A

kal65296221's profile image
kal65296221

asked

Learn Vue.js 3 with Projects

46 Moving pages with useRouter

to와 :to의 차이점

Written on

·

437

0

router-link 태그에서 원래 to로 달려있던 속성을 :to로 바인딩 해주셨는데 이거는 어떤 의미에서 바인딩을 시켜주셨는지 궁금합니다.

vue.js웹앱vuex

Answer 1

0

kossiecoder님의 프로필 이미지
kossiecoder
Instructor

바인딩을 안하면 문자열이구요

바인딩이 되면 변수를 넣어서 사용할수 있습니다

예를 들어

const a = 2;

이라고 하면

to="a" 이 경우는 a라는 문자열이 들어가지만

:to="a" 이 경우는 a의 값인 2가 들어가게 됩니다

kal65296221's profile image
kal65296221

asked

Ask a question