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

242
Visualizações
How to get the value of the ref attribute,

How to get the value wwww of the ref attribute?

    <form @submit.prevent enctype="multipart/form-data">
        <input type="file" ref="wwww" @change="selectFile">
    </form>

I do like this:

console.log(this.$refs.wwww)

But instead of a value, I get like this:

<input type="file">

I need it like this: wwww

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The point of refs is precisely to get a reference to a DOM element. If you're trying to save arbitrary data on your element and access it via JavaScript, I'd recommend using data attributes:

<input type="file" ref="inputElement" data-whatever="wwww">

Then access it like so:

const { inputElement } = this.$refs;
console.log(inputElement.dataset.whatever); // "wwww"

See also Using data attributes and Template refs.

about 4 years ago · Juan Pablo Isaza 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