[Vue警告]:无法安装组件:模板或渲染函数未定义。在<left> <root>中找到

时间:2017-10-24 06:14:19

标签: javascript php vue.js vuejs2 laravel-5.4

我正在使用Laravel 5.4和VueJs 2,在开发过程中我发现了这个错误,试图在互联网上看到几个解决方案,其中一些在stackoverflow中,但是这个错误占了上风。

我的第一个文件

app.js

require('./bootstrap');

window.Vue = require('vue');

import Vue from 'vue'

import VueMaterial from 'vue-material'

import 'vue-material/dist/vue-material.css'

Vue.use(VueMaterial)

import VueRouter from 'vue-router'

Vue.use(VueRouter)

let wall = require('./components/wall.vue');

let cabecalho = require('./components/cabecalho.vue');

let left = require('./components/menu.vue');

let right = require('./components/right.vue');

let duvida = require('./components/form-duvida.vue');

let content = require('./components/content.vue');



const app = new Vue({

    el: '#app',

    router,

    components:{cabecalho, wall, left, right, duvida}

}).$mount('#app')

我的第二个文件

app.blade.php

<div class="main-content" id="app">
    @yield('content')
</div>

<!-- Scripts -->
  <script src="{{ asset('js/app.js') }}"></script>

中调用vue组件

main.blade.php

@extends('layouts.app')

@section('content')
    <left></left>
@endsection

0 个答案:

没有答案