Answer the question
In order to leave comments, you need to log in
Problem with vue-route, nothing works, what could be the problem?
I am using Vue3. I installed vue-router, did everything according to the guides, but for some reason similar errors come out in the browser console.
[Vue warn]: A plugin must either be a function or an object with an "install" function.
Failed to resolve component: router-link at <App>
<template>
<div id="app">
<h1>Title</h1>
<router-link to="/">Home</router-link> |
<router-link to="/todos">About</router-link>
<router-view/>
</div>
</template>
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import About from '@/views/About'
export default new VueRouter({
mode: 'history',
routes: [
{
path: '',
component: Home,
},
{
path: '/about',
component: About,
}
]
})
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
let app = createApp(App)
app.use(router)
app.mount('#app')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question