Vue router not working ( Unknown custom element: )












0















Learning vue, setting it up with Laravel, as project is small I am avoiding npm and importing files via cdn but getting error




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



(found in )



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




1) index.blade.php



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-token" content="{{ csrf_token() }}">
@include('master.partials.css')

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper" id="app">

@include('master.partials.header')

<!-- Left side column. contains the logo and sidebar -->
@include('master.partials.leftSideBar')

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<router-view></router-view>
@yield('content')
</div>
<!-- /.content-wrapper -->

@include('master.partials.footer')
</div>
<!-- ./wrapper -->
@include('master.partials.js')
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
</body>
</html>


2) master.partials.leftSideBar contains router-link



 <li class="active treeview">
<router-link to="/dashboard">Dashboard</router-link>
<a href="#">
<i class="fa fa-dashboard"></i> <span>Dashboard</span>

</a>
</li>


3) resource/js/app.js



require('./bootstrap');

window.Vue = require('vue');
Vue.use(VueRouter);

Vue.component('example-component', require('./components/ExampleComponent.vue'));


const routes = [
{ path: '/dashboard', component: require('./components/dashboard/index.vue') }
]

const app = new Vue({
router
}).$mount('#app')









share|improve this question























  • Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

    – Noogen
    Nov 20 '18 at 18:47
















0















Learning vue, setting it up with Laravel, as project is small I am avoiding npm and importing files via cdn but getting error




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



(found in )



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




1) index.blade.php



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-token" content="{{ csrf_token() }}">
@include('master.partials.css')

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper" id="app">

@include('master.partials.header')

<!-- Left side column. contains the logo and sidebar -->
@include('master.partials.leftSideBar')

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<router-view></router-view>
@yield('content')
</div>
<!-- /.content-wrapper -->

@include('master.partials.footer')
</div>
<!-- ./wrapper -->
@include('master.partials.js')
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
</body>
</html>


2) master.partials.leftSideBar contains router-link



 <li class="active treeview">
<router-link to="/dashboard">Dashboard</router-link>
<a href="#">
<i class="fa fa-dashboard"></i> <span>Dashboard</span>

</a>
</li>


3) resource/js/app.js



require('./bootstrap');

window.Vue = require('vue');
Vue.use(VueRouter);

Vue.component('example-component', require('./components/ExampleComponent.vue'));


const routes = [
{ path: '/dashboard', component: require('./components/dashboard/index.vue') }
]

const app = new Vue({
router
}).$mount('#app')









share|improve this question























  • Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

    – Noogen
    Nov 20 '18 at 18:47














0












0








0








Learning vue, setting it up with Laravel, as project is small I am avoiding npm and importing files via cdn but getting error




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



(found in )



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




1) index.blade.php



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-token" content="{{ csrf_token() }}">
@include('master.partials.css')

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper" id="app">

@include('master.partials.header')

<!-- Left side column. contains the logo and sidebar -->
@include('master.partials.leftSideBar')

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<router-view></router-view>
@yield('content')
</div>
<!-- /.content-wrapper -->

@include('master.partials.footer')
</div>
<!-- ./wrapper -->
@include('master.partials.js')
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
</body>
</html>


2) master.partials.leftSideBar contains router-link



 <li class="active treeview">
<router-link to="/dashboard">Dashboard</router-link>
<a href="#">
<i class="fa fa-dashboard"></i> <span>Dashboard</span>

</a>
</li>


3) resource/js/app.js



require('./bootstrap');

window.Vue = require('vue');
Vue.use(VueRouter);

Vue.component('example-component', require('./components/ExampleComponent.vue'));


const routes = [
{ path: '/dashboard', component: require('./components/dashboard/index.vue') }
]

const app = new Vue({
router
}).$mount('#app')









share|improve this question














Learning vue, setting it up with Laravel, as project is small I am avoiding npm and importing files via cdn but getting error




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



(found in )



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




1) index.blade.php



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="csrf-token" content="{{ csrf_token() }}">
@include('master.partials.css')

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper" id="app">

@include('master.partials.header')

<!-- Left side column. contains the logo and sidebar -->
@include('master.partials.leftSideBar')

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<router-view></router-view>
@yield('content')
</div>
<!-- /.content-wrapper -->

@include('master.partials.footer')
</div>
<!-- ./wrapper -->
@include('master.partials.js')
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
</body>
</html>


2) master.partials.leftSideBar contains router-link



 <li class="active treeview">
<router-link to="/dashboard">Dashboard</router-link>
<a href="#">
<i class="fa fa-dashboard"></i> <span>Dashboard</span>

</a>
</li>


3) resource/js/app.js



require('./bootstrap');

window.Vue = require('vue');
Vue.use(VueRouter);

Vue.component('example-component', require('./components/ExampleComponent.vue'));


const routes = [
{ path: '/dashboard', component: require('./components/dashboard/index.vue') }
]

const app = new Vue({
router
}).$mount('#app')






laravel-5 vue.js






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 18:39









SumeetSumeet

4012




4012













  • Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

    – Noogen
    Nov 20 '18 at 18:47



















  • Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

    – Noogen
    Nov 20 '18 at 18:47

















Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

– Noogen
Nov 20 '18 at 18:47





Where is import VueRouter from 'vue-router' and the declaration of router in that app.js of yours? const router = new Router({ routers }) and so on.

– Noogen
Nov 20 '18 at 18:47












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399435%2fvue-router-not-working-unknown-custom-element-router-link%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399435%2fvue-router-not-working-unknown-custom-element-router-link%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$