How to conditionally call the "activate" method when the user presses the Enter key?
I was hoping the following would work, but it doesn't:
<input type="text" v-model="code" v-on:keyup.enter="code.match(/^\d{6}$/) ? activate : null"> methods: { activate() { ... },
Try this method. Move the logic to another method and call activation from that method if the conditions for calling activation are met.