Parul
Parul

Reputation: 41

Vue file not showing

I am trying to show .Vue file but it is not happening.

In inspect, it shows the vue file but does not give the output

<Root> <ImageComponent> <Om>

ScreenShot of inspect ScreenShot

This is my app.js file

/**
 * 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 same as this one only header and body content is different)

<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 file has

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

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

Thank You

Upvotes: 0

Views: 477

Answers (1)

Parul
Parul

Reputation: 41

Thank You Every One i Got the solution For my error

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

The .default(); was missing.

Upvotes: 1

Related Questions