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

130
Views
vue js increase the value with mousedown

With this code, the pos_number only increases by one when the mouse is held down. How to make a button that will increase the value as long as the mouse is held down?

<button
  @mousedown="setValue({name: 'robotx_increase',value: (robotx_increase = 'true'),});robotx_pos_number ++ "
  @mouseup="setValue({name: 'robotx_increase',value: (robotx_increase = 'false'),})">
</button>

data() {
    return {
      robotx_pos_number: 0
    }
  },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could call a function like 'startAdding()' on the mousedown event, which uses the setInterval method that keeps adding 1 to 'robotx_pos_number' every x milliseconds. This interval should then be cleared with the mouseup event.

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!