Answers for "arrow function with computed property vue"

0

arrow function with computed property vue

<div id="app">
  Name : <input type = "text" v-model = "name" /> <br/><br/>
  My name is : {{getName}}
</div>
    
<script>
new Vue({
  el: '#app',
  data: {
    name:''
  },
  computed:{
    getName: (vm=this) => {         // passing vm = this as parameter
        return vm.name;
    }
  }
});
</script>
Posted by: Guest on March-14-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language