<divid="app"> <h1>Hello App!</h1> <p> <!-- use the router-link component for navigation. --> <!-- specify the link by passing the `to` prop. --> <!-- `<router-link>` will render an `<a>` tag with the correct `href` attribute --> <router-linkto="/">Go to Home</router-link> <router-linkto="/about">Go to About</router-link> </p> <!-- route outlet --> <!-- component matched by the route will render here --> <router-view></router-view> </div>
在 html 上使用 router-link,作為換頁的連結,router-link 在經過編譯後會變成 <a> 標籤。