david001
2 years ago
197
11
Vue

Vue component not displayed:Laravel5.4 and Vue.js2

Posted 2 years ago by david001

I am new to Vue.js and using it with L5,4. In my project view is not displayed .i run npm run watchand its working properly

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');
Vue.http.headers.common['X-CSRF-TOKEN'] = $('meta[name="csrf-token"]').attr('content');

/**
 * 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('test', require('./components/Test.vue'));
Vue.component('upload', require('./components/Upload.vue'));

const app = new Vue({
    el: '#app'
});

upload.blade.php

@extends('layouts.app')
@section('content')
<upload></upload>
@endsection

upload.vue

<template>
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <div class="panel panel-default">
                    <div class="panel-heading">UploadComponent</div>

                    <div class="panel-body">
                      upload...
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        mounted() {
            console.log('Component mounted.')
        }
    }
</script>

but noting is displayed ie upload.vue page not displayed in upload.blade.php

Please sign in or create an account to participate in this conversation.