|
|
- <urban-filemanager-upload>
- <div class="file-upload">
- <div class="file-upload">
- <form onsubmit={ } enctype="multipart/form-data">
- <input name="files[]" type="file" multiple onchange={ handleChange }>
- </form>
- <div class="file-upload__item" each={ file in state.files }>
- { file.name } / { file.size }
- </div>
- </div>
- </div>
- <script>
-
- /**
- *
- * parent Directory
- *
- *
- *
- */
-
- export default {
-
- state: {
- files: []
- },
-
- /**
- *
- *
- * @param Object event
- *
- */
- handleChange(event) {
- console.log(event.target.files)
-
- this.state.files = event.target.files
- this.update()
- }
-
- handleUpload(event) {
-
- const config = {
- onUploadProgress: progressEvent => console.log(progressEvent.loaded)
- }
-
- axios.post('/api/upload/' + id, formData, config)
- .then(function (response) {
- currentObj.success = response.data.success;
- })
- .catch(function (error) {
- currentObj.output = error;
- })
- }
-
- }
-
- </script>
- </urban-filemanager-upload>
|