I'm trying to get the input value on keyup using Vuejs 2 but always get an empty result like the data. Please see code below.
HTML:
<input type="email" @keyup="this.$data.email= $event.target.value" class="form-control" id="email" placeholder="Username (your work email)">
<button type="button" class="btn btn-primary btn-block inactive" @click="submit">Log in</button>
Script:
data () {
return {
email: '',
}
},
methods: {
submit () {
alert(this.$data.email)
}
}