我遇到了问题,因为来自Vue.js的模板未显示在blade.php
中。我从本教程https://www.itechempires.com/2017/10/laravel-5-5-vuejs-2-0-crud-operations-application/一步一步地完成了所有工作,但它无法正常工作。
我的代码:
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'
});
花名册:
@extends('layouts.admin.dashboard')
@section('content')
<task></task>
@endsection
我跑了一口气,但仍然没有。
------------编辑:
问题解决方案缺少<div id="app"> </div>
答案 0 :(得分:0)
缺少问题的解决方案
<div id="app"> </div>
和
<script src="{{ mix('js/app.js') }}"></script>
刀片文件中的。