untymage
2 months ago
91
7
Vue

[Vue warn]: Unknown custom element: <router-view>

Posted 2 months ago by untymage

Any idea why i'm getting this error?:

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

(found in <Root>)

admin.js:


import Vue from 'vue';
import axios from 'axios';
import VueRouter from 'vue-router';
import routes from './routes';


Vue.use(VueRouter);


let app = new Vue({
    el: '#app',
    router: new VueRouter(routes),
});

routes.js :


import Create from './components/admin/form/Create';


export default {

    mode: 'history',

    routes: [
        {
            path: '/admin/create',
            component: Create
        }
    ],
}


master.blade.php:


<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Create</title>
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>

<div id="app">
    <router-view></router-view>
</div>

<script src="{{ asset('admin.js') }}"></script>


</body>
</html>


Please sign in or create an account to participate in this conversation.