You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vue-upload-component/example/Vuex.vue

32 lines
506 B

<template>
<file-upload
name="file"
post-action="/post"
put-action="/put"
:value="files"
@input="input"
ref="upload">
Add upload files
</file-upload>
</template>
<script>
import FileUpload from '../src'
import { mapState } from 'vuex'
export default {
components: {
FileUpload,
},
computed: mapState({
files: state => state.files
}),
methods: {
// Files Event
input(files) {
this.$store.commit('updateFiles', files)
},
},
}
</script>