saimow / vue-media-upload Goto Github PK
View Code? Open in Web Editor NEW๐ผ๏ธ Vue 3 component that handle multiple images upload with preview. This package support the create and the update form.
License: MIT License
๐ผ๏ธ Vue 3 component that handle multiple images upload with preview. This package support the create and the update form.
License: MIT License
Can you include a .d.ts
file in the component so that it could be imported in Typescript-based Vue 3 projects without requiring allowJS: false
?
how can i add some other parameter to server like id and etc?
How to pass header in axios request like a bearer token
const {data} = await axios.post(this.server, formData)
My server requires authentication for server API call but how to send authentication tokens when the component only has server (server="/api/upload") props as a single url for call?
Property "index" was accessed during render but is not defined on instance at Update-media issue. It only occur in update-media, not upload-media.
This is not an Issue. But how do we make it to select only a single file?
For example, the size of the delete icon and colors of buttons.
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;
};
Good day,
I get the following errors in console:
[Vue warn]: Invalid default value for prop "media": Props with type Object/Array must use a factory function to return the default value.
found in ---> <Uploader> at node_modules/vue-media-upload/src/Uploader.vue
It s there anything i m not doing fine?
Edit: I m using this on Vue2
Hi. Is it possible to upload files on drag and drop?
Hey, I think there should be an event so when the axios request fails, an event is triggered.
Something like:
const data = await axios.post(this.server, formData)
.catch( error => {
this.$emit('serverError', error)
});
if( data ){
let addedImage = {url:url, name:data.name, size:files[i].size, type:files[i].type}
this.addedMedia.push(addedImage)
this.$emit('change', this.allMedia)
this.$emit('add', addedImage, this.addedMedia)
}
instead of only:
const {data} = await axios.post(this.server, formData)
What do you think?
Hi there, cool library! I would love to use this in Vue 3, got it on display also but it complains about axios not being defined. I provided the full API path in the "server" tag. Do I have to initialize something in axios?
The delete button svg does appear in the code but its not showing on the page. Now it's not possible to delete any added images. This also goes for the media upload demo
When fetching images from a server and you need to display them through Upload-media tags there is no native support, could you implement that
hi,
how do you do,
how do the project use in framework7 -vue
thanks
toy
I'm trying to upload docs as pdf and it works, but there is no thumbnail icon.
Is it possible to have a generic docs icon?
thanks and compliments!
Update-media's emit events' name is wrong in documentation.
@added_media should be @added-media,
@deleted_media should be @deleted-media,
@saved_media should be @saved-media,
Hello sir.
Is it possible to import it as a script file?
In one of my site I'am using vue as a script file without the use of webpack.
Something like this
<script src="https://unpkg.com/media-upload-component.js"></script>
Thanks!
I think this should be changed to a GET type request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.