vue-router用法
npm install vue-router@4
import { createMemoryHistory, createRouter } from 'vue-router'
<router-link to=""></router-link>等於a標籤
<router-view></router-view>顯示的位置
註冊router
const app = createApp(App)
app.use(router)
app.mount('#app')
npm install vue-router@4
import { createMemoryHistory, createRouter } from 'vue-router'
<router-link to=""></router-link>等於a標籤
<router-view></router-view>顯示的位置
註冊router
const app = createApp(App)
app.use(router)
app.mount('#app')
Comments