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

243
Views
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 answers
Answer question

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 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!