Skip to content

Using multiple times #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GalBrigitta opened this issue Jun 29, 2023 · 2 comments
Closed

Using multiple times #20

GalBrigitta opened this issue Jun 29, 2023 · 2 comments

Comments

@GalBrigitta
Copy link

I tried to use in a form multiple times but it does not work.
I would need it for example if a model has a basic photo and other media collections. Even if I want to upload at the second one, it appears at the first one

   <div class="row g-4 mt-1">
          <Uploader server="/store-media" @change="changeBasicMedia"/>
        </div>
        <div class="row g-4 mt-1">
          <Uploader server="/store-media" @change="changeMediaCollection"/>
        </div>
const basicMedia = ref();
const mediaCollection = ref([]);

const changeBasicMedia = (basic) => {
  basicMedia.value = basic;
};

const changeMediaCollection = (collection) => {
  mediaCollection.value = collection;
};
@GalBrigitta
Copy link
Author

GalBrigitta commented Jul 10, 2023

I've created a pull request for that and also for an other issue:
Ability to use Uploader twice or more in one component, so I added an input id param which is not required.
Adding dynamic folder as the media id, as using laravel spatie package and the folder structure is like that. Also adding a param if this is used, default is false.

@lutuh
Copy link

lutuh commented Oct 6, 2023

@GalBrigitta Thank you very much for your Pull Request! I was stuck on using multiple instances of the uploader and you gave me the hint into the right direction.

@saimow Please consider a merge. Thank you!

@saimow saimow closed this as completed in d5a845c Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants