Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
923 changes: 528 additions & 395 deletions dist/example.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/example.js.map

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions dist/vue-upload-component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-upload-component.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-upload-component.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-upload-component.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-upload-component",
"description": "Vue.js file upload component, Support for multiple file uploads, progress, html5, html4, support ie9",
"version": "2.3.0-beta.2",
"version": "2.3.0",
"author": "LianYue",
"scripts": {
"dev": "webpack-dev-server --inline --hot",
Expand Down
24 changes: 8 additions & 16 deletions src/FileUpload.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<template>
<label class="file-uploads" :class="mode === 'html5' ? 'file-uploads-html5' : 'file-uploads-html4'">
<span>{{title}}</span>
<slot></slot>
<input-file></input-file>
</label>
</template>

<style>
.file-uploads {
overflow: hidden;
Expand Down Expand Up @@ -140,22 +148,6 @@ export default {
this.files.splice(0, this.files.length);
},

render (h) {
return (
<label class={{
'file-uploads': true,
'file-uploads-html5': this.mode == 'html5',
'file-uploads-html4': this.mode == 'html4'
}} >
<span>{this.title}</span>
<input-file></input-file>
</label>
)
},




watch: {
drop(value) {
this._drop(value);
Expand Down
33 changes: 16 additions & 17 deletions src/InputFile.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<template>
<div>
<input
type="file"
:name="$parent.name"
:id="$parent.id || $parent.name"
:accept="$parent.accept"
@change="change"
:multiple="$parent.multiple && $parent.mode === 'html5'"
/>
</div>

</template>
<script>
export default {
methods: {
change(e) {
this.$destroy();
this.$parent._addInputFileElement(e.target);
},
},

render(h) {
const parent = this.$parent;
return (
<input
type="file"
name={parent.name}
id={parent.id|| parent.name}
accept={parent.accept}
on-change={this.change}
multiple={parent.multiple && parent.mode == 'html5'}
/>
)
this.$destroy()
this.$parent._addInputFileElement(e.target)
}
}
}
</script>