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

234
Views
How can I set vue.js input element via JS

I have a input made by vue.js's built-in components. I want to be able to set a value and submit this value to be able to create automated tests. How can I accomplish this?

Currently this is how I set value, but on submit this value is changed with the default data automatically.

    Execute JavaScript    return element.value = "${startDate}"
almost 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Simply run dispatchEvent method on the component itself. This will let Vue to set the value that you've entered to the form data

Execute JavaScript    return element.dispatchEvent(new Event('input'));
almost 4 years ago · Santiago Trujillo Report

0

Creating a new dispatchHandler fixed my problem!

Execute JavaScript    return element.value = "${startDate}"
Execute JavaScript    return element.dispatchEvent(new Event('input'));
almost 4 years ago · Santiago Trujillo 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!