title: how can i output the result of a currency exchange rate with v-model?
body: <p>Problem: I am trying to make a currency exchange that output the value of the selected coin as the user types in their figure but it's not outputting the result in my case.</p>
  <p>I have tried all what i know and can find reading the Vue documentation and checked some sample code but can't find a solution to it to what the issue is.
  please it'll be kind of someone to help me out here</p>
  <pre><code>    &lt;div class=&quot;exchange-button&quot;&gt;
          &lt;input type=&quot;number&quot; placeholder=&quot;1&quot; v-model.number=&quot;qty&quot;&gt;
            &lt;select v-model=&quot;fromcoin&quot;&gt;
            &lt;option v-for=&quot;coin in coins&quot; :value=&quot;coin.code&quot; :key=&quot;coin.code&quot;&gt;{{ coin.code }}&lt;/option&gt;  
             &lt;/select&gt;
       &lt;/div&gt;
  
                                  
   &lt;div class=&quot;exchange-button&quot;&gt;
       &lt;input type=&quot;text&quot; v-model.number=&quot;result&quot; readonly&gt;
         &lt;select v-model=&quot;tocoin&quot;&gt;
          &lt;option v-for=&quot;coin in coins&quot; :value=&quot;coin.code&quot; :key=&quot;coin.code&quot;&gt;{{ coin.code }}&lt;/option&gt;
         &lt;/select&gt;
    &lt;/div&gt;
                       
  </code></pre>
  <p>// below here is the script of the page</p>
  <pre><code>&lt;script&gt;
                                     
      export default{
          data(){
              return{
               coins: [
                  {code: 'BTC'},
                  {code: 'ETH'},
                  {code: 'LTC'}
               ],
                   coin: null,
                   qty: &quot;&quot;,
                   result : null,
                   fromcoin : &quot;BTC&quot;,
                   tocoin : &quot;ETH&quot;
                   
               }
              
          },
        
          computed: {
             total(){
               let to = this.tocoin
               let from = this.frmcoin
              
      
               switch(from){
                   case &quot;BTC&quot; :{
                       if (to === &quot;ETH&quot;){
                           result = this.qty * 300;
                       }
                       if (to === &quot;LTC&quot;){
                           result = this.qty * 1000;
                       }
                       if (to === &quot;BTC&quot;) {
                           result = this.qty;
                       }
                       }
                       break;
                       case &quot;ETH&quot; :{
                           if(to === &quot;BTC&quot;){
                               result= this.qty * 15;
                           }
                           if(to === &quot;LTC&quot; ){
                               result= this.qty * 500;
                           }
                           if(to === &quot;ETH&quot;) {
                               result= this.qty;
                           }
      
                       }break;
      
                       case &quot;LTC&quot;:{
                           if(to === &quot;BTC&quot;){
                               result= this.qty * 1000;
                           }
                           if(to === &quot;ETH&quot;){
                               result== this.qty * 500;
                           }if(to === &quot;LTC&quot;){
                               result= this.qty;
                           }break;
                       }
                      
                   } return result;
      
               }
          }
  
      
      }
  
   &lt;/script&gt;
  </code></pre>