2017-12-23 7 views
0

Ich habe ein Problem, weil Vorlage von Vue.js nicht in blade.php angezeigt wird. Ich habe alle Schritt für Schritt von diesem Tutorial https://www.itechempires.com/2017/10/laravel-5-5-vuejs-2-0-crud-operations-application/ gemacht und es funktioniert nicht.Vorlage nicht in Laravel 5.5 und Vue.js

Mein Code:

Roster.vue

<template> 
    <div class="container"> 
     <div class="row"> 
      <div class="col-md-12"> 
       <div class="panel panel-default"> 
        <div class="panel-heading">Roster</div> 

        <div class="panel-body"> 

        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
</template> 

<script> 
    export default { 
     mounted() { 

     } 
    } 
</script> 

app.js

/** 
* First we will load all of this project's JavaScript dependencies which 
* includes Vue and other libraries. It is a great starting point when 
* building robust, powerful web applications using Vue and Laravel. 
*/ 

require('./bootstrap'); 

window.Vue = require('vue'); 

/** 
* Next, we will create a fresh Vue application instance and attach it to 
* the page. Then, you may begin adding components to this application 
* or customize the JavaScript scaffolding to fit your unique needs. 
*/ 

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

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

Roster Klinge:

@extends('layouts.admin.dashboard') 


@section('content') 


<task></task> 

@endsection 

ich schluck Uhr lief und immer noch nichts.

------------ edit: Lösung für Problem fehlte <div id="app"> </div>

+0

Öffnen Sie die Entwicklerkonsole und überprüfen Sie die Fehler dort. –

+0

@u_mulder Vue wird nicht erkannt, weiß nicht, warum – tomczas

+3

Ihre Komponente heißt Roster so in Ihrer Klinge sollten Sie schreiben ' – nemesv

Antwort

0

Lösung für Problem fehlte <div id="app"> </div> und

<script src="{{ mix('js/app.js') }}"></script> 

in Blade-Datei.