[英]Template not showing in Laravel 5.5 and Vue.js
I have a problem because template from Vue.js is not showing in blade.php
.我有一个问题,因为 Vue.js 的模板没有显示在blade.php
。 I did all step by step from this tutorial https://www.itechempires.com/2017/10/laravel-5-5-vuejs-2-0-crud-operations-application/ and it's not working.我从本教程https://www.itechempires.com/2017/10/laravel-5-5-vuejs-2-0-crud-operations-application/一步一步完成了所有工作,但它不起作用。
My code:我的代码:
Roster.vue名册.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应用程序.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 blade:名册刀片:
@extends('layouts.admin.dashboard')
@section('content')
<task></task>
@endsection
I ran gulp watch and still nothing.我跑了 gulp watch 还是什么都没有。
------------edit: Solution for problem was missing <div id="app"> </div>
------------编辑:问题的解决方案丢失<div id="app"> </div>
Solution for problem was missing <div id="app"> </div>
and问题的解决方案是缺少<div id="app"> </div>
和
<script src="{{ mix('js/app.js') }}"></script>
in blade file.在刀片文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.