P
P
PiligrimDima2021-01-21 20:16:13
Vue.js
PiligrimDima, 2021-01-21 20:16:13

Why is router-view not working?

I can't figure out why it doesn't work.
The dependency is set. In the folder: src created a folder: router in it the file router.js in it the following code:

import Vue from 'vue'
import Router from 'vue-router'

import vCatalog from '../components/v-catalog'
import vCatalog from '../components/v-cart'

Vue.use(Router)

let router = new Router({
    routes: [
        {
            path: '/',
            name: 'catalog',
            component: vCatalog
        },
        {
            path: '/cart',
            name: 'cart',
            component: vCart
        }
    ]
})
export default router


The main component has the following code:
<template>
    <div class="v-main-wrapper">
       <router-view></router-view>
    </div>
</template>


The following error appears in the console:

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> at src/components/v-main-wrapper.vue
at src/App.vue

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question