模板没有在Laravel 5.5和Vue.js中显示

问题描述 投票:0回答:1

我有一个问题,因为来自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>

javascript laravel vue.js
1个回答
0
投票

问题的解决方案缺少<div id="app"> </div>

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

在刀片文件中。

© www.soinside.com 2019 - 2024. All rights reserved.