Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda