No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    q-input and type file

    Help
    2
    4
    5802
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gregorybleiker last edited by

      Hi
      I’m using

      <q-input v-model="thefile" @change="onFileChange" type="file"/>
      

      and

        onFileChange(e) {
            debugger;
          let files = e.target.files || e.dataTransfer.files;
          if (!files.length) {
            return;
          }
          this.createInput(files[0]);
        }
      

      in the component. However, neither ist “thefile” bound to the input value, nor is the onFileChange method triggered. Any pointers on what I am doing wrong?

      1 Reply Last reply Reply Quote 0
      • a47ae
        a47ae last edited by

        It seems like QInput is not working with file inputs. Use a normal input instead.
        Also if you use a normal input, Vue will tell you

        File inputs are read only. Use a v-on:change listener instead.

        So you need to delete the v-model

        1 Reply Last reply Reply Quote 0
        • G
          gregorybleiker last edited by

          I guess I should open an issue on github then…?

          1 Reply Last reply Reply Quote 0
          • a47ae
            a47ae last edited by

            There is http://quasar-framework.org/components/uploader.html so I think this is kind of intended.
            And also what should be displayed in the input? It would be more like a button and does not integrate well with the q-input design.
            But maybe @rstoenescu can tell you if it is intended.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post