알린홈마의 코드친구들
article thumbnail
뷰 라우터 / Vue.js router params 이동
JS/Vue.js 2022. 4. 21. 15:21

1. node.js를 이용해 뷰 라우터를 깔아주자! npm install vue-router@4 설치된 뷰버전이 Vue 3 이기 때문에 라우터 라이브러리도 4버전을 설치해주자 2. router.js 생성 src 파일안에 router.js 파일을 생성을 해서 라우터를 사용할 준비를 하자. import { createWebHistory, createRouter } from "vue-router"; const routes = [ { path: "/경로", component: import해온 컴포넌트, } ]; const router = createRouter({ history: createWebHistory(), routes, }); export default router; 기본 셋팅이다. 뷰 라우터를 만든 ..

profile on loading

Loading...