lundi 28 janvier 2019

can't display vue-router in laravel blade

I am getting an error, when I try to display vue router in Laravel's blade.

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

found in

--->

I am @yeild the router.

<router-view></router-view>

   @yield('content') 

and my app.js

import VueRouter from 'vue-router'

Vue.use(VueRouter)


const EstateIndex = require('./components/estates/Index.vue');
const routes = [
  {
    path: '/estates',
    name: 'estates.index',
    component: EstateIndex
  }
];

const router = new VueRouter({
  mode: 'history',
  routes

})

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

Any idea?

Also if you need to see Routes then here:

Route::get('/estates', function(){
  return view('estates.index');
});

index.blade

@extends('layouts.app')



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2sStzbB
via IFTTT

Aucun commentaire:

Enregistrer un commentaire