pqina / vue-filepond

🔌 A handy FilePond adapter component for Vue
https://pqina.nl/filepond
MIT License
1.91k stars 128 forks source link

array from v-for [v-model] ? #257

Closed andysay closed 2 years ago

andysay commented 2 years ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

 <div
                v-for="(input, index) in portfolio"
                ref="mPort"
                :key="`portfolio-${index}`"
                class="pb-4"
              >
                <div class="grid grid-cols-1 gap-4">
                  <div>
                    <file-pond
                      name="userPorfolio"
                      ref="portfolio"
                      accepted-file-types="image/jpeg, image/png"
                      allow-multiple="true"
                      instantUpload="true"
                      max-files="1"
                      class="h-full"
                      v-model="input.photo"
                      :server="{ process, revert, restore, load, fetch }"
                    />
                  </div>
</div>

methods : { 
    async process(fieldName, file, metadata, load, error, progress, abort) {
        let wdata= await axios.post("/api/upload", formData, {
          params: {
            token: user.token,
          },
        });
        load();

        let str = w.data.replace(/[^A-Za-zА-Яа-я0-9,.]/g, " ");
        let result = str.replace(/^ +| +$|( ) +/g, "$1");
        var arr = result.split(",");

        if (fieldName === "userPorfolio") {
          how return input.photo = arr ?
        }

}

how return input.photo = arr ?

Describe the solution you'd like

up

Describe alternatives you've considered

up

andysay commented 2 years ago

please how made it?

rikschennink commented 2 years ago

It's unclear what the question is, additionally this issue tracker is for bugs only, please submit questions on Stack Overflow.