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

101
Views
Handle File Input in vuejs?

i have tried about open file input with button . but, when i click the button client said: "this.$refs.image.click" and this is my code

<v-btn
                      height="50"
                      width="180"
                      color="#6C63FF"
                      class="mx-8 my-4"
                      @click="selectFile()"
                    >
                      <v-icon color="white"> mdi-image-plus </v-icon></v-btn
                    >

                    <input
                      ref="image"
                      type="file"
                      accept="image/*"
                      style="display: none"
                      @change="getFileImage"
                      multiple
                    />
                  </v-col>
methods: {
    selectFile() {
      this.$refs.image.click()
    },
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Its working fine, pls crosscheck your code with the below code

var app = new Vue({
 el: '#app',
 vuetify: new Vuetify(),
 methods: {
  openModal() {
   this.$refs.image.click();
  }
 }
});
<html>
<head>
  <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
  <div id="app">
    <v-app>
      <v-main>
        <v-container>
         <v-btn
         height="50"
         width="180"
         color="#6C63FF"
         class="mx-8 my-4"
         @click="openModal()"><v-icon color="white"> mdi-image-plus </v-icon></v-btn>
         <input ref="image"
                  type="file"
                  accept="image/*"
                  style="display: none" style="display: none" multiple/> 
        </v-container>
      </v-main>
    </v-app>
  </div>
  </body>
</html>

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!