title: Vuejs Input Binding Based on Computed Property
body: <p>I have a scenario where I want the v-model binding of an Input field to be decided by the value returned by a computed property.</p>
  
  <p>Please see the example below:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://unpkg.com/vue@2.1.10/dist/vue.js"&gt;&lt;/script&gt;
  &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /&gt;  
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width"&gt;
    &lt;title&gt;JS Bin&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="app" class="container-fluid"&gt;
      &lt;h2&gt;Input Binding&lt;/h2&gt;
      &lt;p&gt;&lt;b&gt;First Name&lt;/b&gt;&lt;/p&gt;
      &lt;input type="text" v-model="value.first" placeholder="Enter first name" /&gt;
      &lt;p style="margin-top:20px;"&gt;&lt;b&gt;Second Name&lt;/b&gt;&lt;/p&gt;
      &lt;input type="text" :v-model="lastName" placeholder="Enter last name" /&gt;
      &lt;hr /&gt;
      &lt;p&gt;{{value.first}} {{value.second}}&lt;/p&gt;
      &lt;hr /&gt;
      &lt;p&gt;Value of computed property: {{lastName}}&lt;/p&gt;
    &lt;/div&gt;
    &lt;script&gt;  
     new Vue({
        el: '#app',
        data: function() {
          return {
            value: {
            first:'',
            second:''}
          }
        },
      computed: {
          // a computed getter
          lastName: function() {
              return 'value.second'
          } 
        }     
      });
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>As you can see in the above code, I want the first field to be bound to value.first so I have chosen v-model="value.first". For the second field, I want the model binding to be decided by the value returned from computed property. Right now it's a simple example and there's only one returned value, i.e., value.second. But this will be decided on logic.</p>
  
  <p>Right now when I try to do that binding, it doesn't return anything. Any help is greatly appreciated.</p>