Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda