Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
Accessing vuetify v-text-field value for another text field

I want to make a username suggestion based on users first and last name. The idea is after user finished first name and last name field, the username field value will be first + last name.

firstName = Bobby
lastName = Brown
username = BobbyBrown
<v-text-field
    v-model="firstName"
    label="First Name"
></v-text-field>

<v-text-field
    v-model="lastName"
    label="Last Name"
></v-text-field>

<v-text-field
    v-model="username"
    label="Username"
></v-text-field>

<script>
export default ({
  data() {
    return {
        firstName: '',
        lastName: '',
        username: '',
    }
  },
})
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

username should be declared as computed property with set/get methods:

<script>
export default ({
  data() {
    return {
        firstName: '',
        lastName: '',
       
    }
  },
computed:{
   username:{
      get(){ 
           return this.firstName+' '+this.lastName;
        },
      set(val){
          const [first,last]=val.split(' ');
          this.firstName=first;
          this.lastName=last;
        }

}
})
</script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!