Vue 中的路由是在“main.js”文件中设置的。
填写下面的空白,以便路由创建成功。
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import FishTypes from './components/FishTypes.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{ @(4): '/fish', @(9): FishTypes }
]
});
const app = createApp(App)
app.use(router);
app.mount('#app')
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import FishTypes from './components/FishTypes.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/fish', component: FishTypes }
]
});
const app = createApp(App)
app.use(router);
app.mount('#app')