cleopatra
199
3
Vue

Vue App Error in Laravel

Posted 1 month ago by cleopatra

I tried to build a user management system with Vue and Laravel. and install Vue-router to load vue components. And I got the following error for my routes.

[Vue warn]: Failed to mount component: template or render function not defined.

found in

--->

This is my app.js code

require('./bootstrap');

window.Vue = require('vue');

import VueRouter from 'vue-router'

Vue.use(VueRouter)

let routes = [ { path: '/dashboard', component: require('./components/Dashboard.vue') }, { path: '/profile', component: require('./components/Profile.vue') } ]

const router = new VueRouter({ routes })

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

const app = new Vue({ el: '#app', router });

Link : <router-link to="/dashboard" class="nav-link">Dashboard</router-link>

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