[Vuejs]-Cannot access to my Vuejs methods and attributes in EJS file

0👍

Hope you found a solution already. But for someone looking for that solution, here it is.

It is quiet simple actually, you forgot to define where the Vue logic/app should be mounted, like so:

<script>
    const vue = new Vue({

        // add this:
        el: '#signup-form',
        // that's all


        data: {
            email: '',
            password:''
        },
        methods: {
            signup: function () {
                console.log('email is: ' + this.email)
            }
        }
    })
</script>

Maybe you can let us know if that works for you.
Happy coding

Leave a comment