먼저 예제를 위해 필요한 파일들을 생성해보자. index.html App.js index.js 페이지 만들기 페이지는 메인 페이지, 상세 페이지, 404 페이지 세개를 구현한다. 페이지는 모두 다음과 같은 형식을 갖추고 있다. 현재 URL에 따라 페이지 불러오기 URL에 대한 정보를 받기 위해 location Web API의 pathname ...
Router Router를 다음과 같이 구현했다. router.js Router를 App에 적용시켜보자. App.js 예제 https://piuvoo.csb.app/ !codesandbox[lucid-wilson-piuvoo?fontsize=14&hiden
지금까지 History Web API의 History.pushState를 활용하여 Router를 구현했다. 그런데 이 방법 외에도 SPA Framework의 Router를 구현할 수 있는 방법이 있다. 바로 hash를 활용하는 방법이다. Vue Router - Has