Answers for "snippiest store"

0

snippiest store

<template>
  <div>    
    <div> <h1>{{ fullname }}</h1> </div>
    
     <v-text-field
      label="Full Name"
v-model="fullname"
      hide-details="auto"
    ></v-text-field>
     <v-text-field
      label="First Name"
v-model="firstname"
      hide-details="auto"
    ></v-text-field>
     <v-text-field
      label="Last Name"
v-model="lastname"
      hide-details="auto"
    ></v-text-field>
  </div>
</template>

<script>
export default {
  data () {
    return {
      firstname:'Sandeep',
      lastname:'Thapa',
    }
  },
  computed: {
    fullname: {
      set:function(value){
        var fullname = value.split(' ')
        this.firstname = fullname[0]
        this.lastname = fullname[fullname.length -1]
      },
      get:function(){
        return this.firstname + " " + this.lastname}
    }
  }, 
}
</script>
Posted by: Guest on May-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language