2

I have a fresh installation of Laravel 5.3 project which built in with example Vue component.

require('./bootstrap');

Vue.component('example', require('./components/Example.vue'));

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

I then tried to add

<example></example> 

in welcome.blade.php, saved it, but nothing changed.

I run gulp watch, too even I didn't change any JS file.

Did I miss something? Or this is not the way Vue component works?

1
  • Does vue print something in javascript console? Commented Oct 7, 2016 at 12:40

1 Answer 1

2

Did you include app.js in welcome.blade.php?

<body>
    <div id="app">
        <example></example>
    </div>
    <script src="{{ asset('js/app.js') }}"></script>
</body>

You probably did so, but also be sure to add an element with the id (in this case #app) you defined in the options of your Vue instance.

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

1 Comment

Maybe you can help me. Look at this : stackoverflow.com/questions/49664451/…

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.