Laravel-vue

Posted 5 months ago by deepu07

Hello Folks, I'm trying to build a blog with Laravel-vue. But I'm unable to load vue.js. It is getting an error. I couldn't find why it is not loading can anyone help me?

Thanks in advance

    <div id="app" class="container">
        @include ('projects.list')      

        <form method="POST" action="/projects" @submit.prevent="onSubmit">
        @csrf
            <div class="control">
                <label for="name" class="label">Project Name:</label>
                <input type="text" id="name" name="name" class="input"> 
            </div>

            <div class="control">
                <label for="description" class="label">Project Description:</label>
                <input type="text" id="description" name="description" class="input">
            </div>
    <br>
            <div class="control">
                <button class="button is-primary">Create</button>
            </div>
        </form>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
    <script src="../resources/assets/js/app.js"></script>
</body>
</html>```


#app.js
```const app = new Vue({
    el: '#app',

    data: {

    },

    methods: {
        onSubmit() {
           axios.post('/projects', this.$data);
        }
    },
});

#ERROR

In console im getting GET http://localhost:8888/larapower/public/resources/assets/js/app.js 404 (Not Found)

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

Reply to

Use Markdown with GitHub-flavored code blocks.