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-uploader Manually Add Files

    Framework
    1
    2
    849
    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.
    • K
      Kentoncloud last edited by

      Hi there,

      Do you have any sample on how to manually add files? I have successfully uploaded the images but repopulating it seems confusing.

      My code:

      mounted(){
      if (this.locProduct.images != null) {
            for (var i = 0; i < this.locProduct.images.length; i++) {
              let fileName = this.locProduct.images[i].name
              let url = this.locProduct.images[i].path_url
      
              // Add file size to the database images
              let file = {
                id: this.locProduct.images[i].id,
                size: 123,
                type: fileName.split('.').pop(),
                name: fileName,
                __img: {
                  src: url
                }
              }
              console.log(file)
              this.added([file])
            }
          }
      }
      
      methods: {
      added (files) {
            console.log(files)
            this.selectedFile.push(files[0])
          },
      }
      
      1 Reply Last reply Reply Quote 0
      • K
        Kentoncloud last edited by

        I solved this by

        this.$refs.uploader.addFiles([file])

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