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

220
Views
Vue v-model and @keydown in one element
          <input
            v-model="ticker"
            @keydown.enter="addClick($event)"
            
            @keydown="getNames"

I need to solve 1 problem, my v-model ticker I guess works after keydown, therefore when function is called I have into it ticker without 1 symbol, can anyone explain how it works?

getNames() {
      console.log(this.ticker);
      let filtred = this.coinNames.filter(filtered => filtered.toUpperCase().startsWith(this.ticker.toUpperCase()))
      console.log(filtred);
      return filtred;
}

Examle:
input: something
output: somethin
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should use @input event to get the current input value :

new Vue({
  el: '#app',

  data() {
    return {
      ticker: ''
    }
  },
  methods: {
    getNames() {
      console.log(this.ticker);

    },
    addClick(e) {
      console.log('enter')
    }
  }
})
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap/dist/css/bootstrap.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>


<div id="app" class="container">
  <input v-model="ticker" @keydown.enter="addClick($event)" @input="getNames" />
</div>

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!