0

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

3
  • 1
    Any errors in the browser's console? What about inspecting the elements in the Elements tab of the browser's developer tools, what elements do you see there? Commented Dec 2, 2019 at 11:58
  • Can you see the console.log('Component mounted.') in the browser console ? Commented Dec 2, 2019 at 12:03
  • Have you tried naming it in lowercase and renaming it to OmComponent.vue Commented Dec 2, 2019 at 12:05

1 Answer 1

1

Thank You Every One i Got the solution For my error

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

The .default(); was missing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.