Binding Input in Vue not working
<p>I would like to call a function with a value when a user starts typing in an input box. I have tried two approaches.</p>

<p>The first approach is trying to use two-way binding to a model. However, after following the documentation I get an error.</p>

<p>Here is the example from the official docs:</p>

<pre><code>&lt;div id="app-6"&gt;
  &lt;p&gt;{{ message }}&lt;/p&gt;
  &lt;input v-model="message"&gt;
&lt;/div&gt;


var app6 = new Vue({
  el: '#app-6',
  data: {
    message: 'Hello Vue!'
  }
})
</code></pre>

<p>And here's my example:</p>

<pre><code>&lt;template lang="html"&gt;
  &lt;input
    type="text"
    v-model="handle"
  /&gt;
&lt;/template&gt;


&lt;script&gt;    
  export default {
    data: {
      handle: 'model',
    }
  };
&lt;/script&gt;
</code></pre>

<p>I am writing this as part of an application so I chose not to recreate the Vue instance and I declared that elsewhere. However, I get this error: </p>

<blockquote>
  <p>Property or method "handle" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.</p>
</blockquote>

<p>A second approach I've tried is this calling a function directly from the view via an event handler. I'm coming from React so this is my preferable approach. However, the function has undefined as an input value meaning it's not picking up the value of the input.</p>

<pre><code>&lt;template lang="html"&gt;
  &lt;input
    type="text"
    v-on:keyup="handleInput()"
  /&gt;
&lt;/template&gt;

&lt;script&gt;
  export default {
    methods: {
      handleInput(input) {
        // input -&gt; undefined
      },
    },
  };
&lt;/script&gt;
</code></pre>

<p>I really can't see why neither of these works. Wouldn't the expected behavior of an input listener would be to pass the value?</p>

<p>Where am I going wrong?</p>

<p>It seems like you might have to do something like this: <a href="https://stackoverflow.com/questions/33257379/how-to-fire-an-event-when-v-model-changes-vue-js">How to fire an event when v-model changes ? (vue js)</a>.  What I don't understand is why you have to manually attach a watcher when you have assigned a v-model?  Isn't that what a v-model is supposed to do?</p>

<p>What finally worked was this:</p>

<pre><code>&lt;template lang="html"&gt;
  &lt;input
    type="text"
    v-model="searchTerm"
    @keyup.enter="handleInput"
  /&gt;
&lt;/template&gt;


&lt;script&gt;
  export default {
    data() {
       return { searchTerm: '' }
    },
    methods: {
      handleInput(event) {/* handle input */},
    },
  };
&lt;/script&gt;
</code></pre>