Vue文件未显示

时间:2019-12-02 11:52:02

标签: laravel vue.js

我正在尝试显示.Vue文件,但没有发生。

在inspect中,它显示vue文件,但不提供输出

<Root> <ImageComponent> <Om>

ScreenShot检查 ScreenShot

这是我的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');

 Vue.component('image-component', require('./components/ImageuploadComponent.vue'));
 Vue.component('Om', require('./components/Om.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.
 */


 const app =

    new Vue({
   el: '#chat',
 });

./ components / ImageuploadComponent.vue (./components/Om.vue与这一点相同,只是标题和正文内容不同)

<template>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card card-default">
                    <div class="card-header">Example Component</div>
                    <div class="card-body">
                        I'm an example component.
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        mounted() {
            console.log('Component mounted.')
        }
    }
</script>

blade.php文件具有

<div id="chat">
    <image-component></image-component>
    <Om></Om>
</div>

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

谢谢

1 个答案:

答案 0 :(得分:1)

谢谢大家,我为我的错误提供了解决方案

 Vue.component('Om', require('./components/Om.vue').default);

.default();丢失。