Add Features #44

master
git 9 years ago
parent 656a9b6509
commit cb7d7bc864

38
dist/example.js vendored

@ -8823,7 +8823,7 @@
return _ref = { return _ref = {
accept: 'image/*' accept: 'image/*'
}, (0, _defineProperty3.default)(_ref, 'accept', ''), (0, _defineProperty3.default)(_ref, 'size', 1024 * 1024 * 10), (0, _defineProperty3.default)(_ref, 'multiple', true), (0, _defineProperty3.default)(_ref, 'extensions', 'gif,jpg,png'), (0, _defineProperty3.default)(_ref, 'files', []), (0, _defineProperty3.default)(_ref, 'upload', {}), (0, _defineProperty3.default)(_ref, 'title', 'Add upload files'), (0, _defineProperty3.default)(_ref, 'drop', true), (0, _defineProperty3.default)(_ref, 'auto', false), (0, _defineProperty3.default)(_ref, 'name', 'file'), (0, _defineProperty3.default)(_ref, 'postAction', './post.php'), (0, _defineProperty3.default)(_ref, 'putAction', './put.php'), (0, _defineProperty3.default)(_ref, 'headers', { }, (0, _defineProperty3.default)(_ref, 'accept', ''), (0, _defineProperty3.default)(_ref, 'size', 1024 * 1024 * 10), (0, _defineProperty3.default)(_ref, 'multiple', true), (0, _defineProperty3.default)(_ref, 'extensions', 'gif,jpg,png'), (0, _defineProperty3.default)(_ref, 'files', []), (0, _defineProperty3.default)(_ref, 'upload', {}), (0, _defineProperty3.default)(_ref, 'title', 'Add upload files'), (0, _defineProperty3.default)(_ref, 'drop', true), (0, _defineProperty3.default)(_ref, 'auto', false), (0, _defineProperty3.default)(_ref, 'thread', 1), (0, _defineProperty3.default)(_ref, 'name', 'file'), (0, _defineProperty3.default)(_ref, 'postAction', './post.php'), (0, _defineProperty3.default)(_ref, 'putAction', './put.php'), (0, _defineProperty3.default)(_ref, 'headers', {
"X-Csrf-Token": "xxxx" "X-Csrf-Token": "xxxx"
}), (0, _defineProperty3.default)(_ref, 'data', { }), (0, _defineProperty3.default)(_ref, 'data', {
"_csrf_token": "xxxxxx" "_csrf_token": "xxxxxx"
@ -9072,6 +9072,9 @@
default: function _default() { default: function _default() {
return []; return [];
} }
}), (0, _defineProperty3.default)(_props, 'thread', {
type: Number,
default: 1
}), _props), }), _props),
data: function data() { data: function data() {
@ -9180,7 +9183,12 @@
}, },
active: function active(newValue, oldValue) { active: function active(newValue, oldValue) {
if (newValue && !oldValue) { if (newValue && !oldValue) {
this._fileUploads(); for (var i = 0; i < this.thread; i++) {
this._fileUploads();
if (this.mode != 'html5') {
break;
}
}
} }
}, },
uploaded: function uploaded(_uploaded) { uploaded: function uploaded(_uploaded) {
@ -11024,6 +11032,7 @@
"accept": _vm.accept, "accept": _vm.accept,
"multiple": _vm.multiple, "multiple": _vm.multiple,
"size": _vm.size || 0, "size": _vm.size || 0,
"thread": _vm.thread < 1 ? 1 : (_vm.thread > 5 ? 5 : _vm.thread),
"headers": _vm.headers, "headers": _vm.headers,
"data": _vm.data, "data": _vm.data,
"drop": _vm.drop, "drop": _vm.drop,
@ -11220,6 +11229,31 @@
} }
} }
} }
})])]), _vm._v(" "), _c('td', [_c('label', [_vm._v("\n Thread: "), _c('input', {
directives: [{
name: "model",
rawName: "v-model.number",
value: (_vm.thread),
expression: "thread",
modifiers: {
"number": true
}
}],
attrs: {
"type": "text"
},
domProps: {
"value": (_vm.thread)
},
on: {
"input": function($event) {
if ($event.target.composing) { return; }
_vm.thread = _vm._n($event.target.value)
},
"blur": function($event) {
_vm.$forceUpdate()
}
}
})])])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("\n Auto start: " + _vm._s(_vm.auto) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Active: " + _vm._s(_vm.upload.active) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Uploaded: " + _vm._s(_vm.upload.uploaded) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Drop active: " + _vm._s(_vm.upload.dropActive) + "\n ")])])])])]), _vm._v(" "), _c('div', { })])])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("\n Auto start: " + _vm._s(_vm.auto) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Active: " + _vm._s(_vm.upload.active) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Uploaded: " + _vm._s(_vm.upload.uploaded) + "\n ")]), _vm._v(" "), _c('td', [_vm._v("\n Drop active: " + _vm._s(_vm.upload.dropActive) + "\n ")])])])])]), _vm._v(" "), _c('div', {
directives: [{ directives: [{
name: "show", name: "show",

File diff suppressed because one or more lines are too long

@ -716,6 +716,9 @@ return /******/ (function(modules) { // webpackBootstrap
default: function _default() { default: function _default() {
return []; return [];
} }
}), (0, _defineProperty3.default)(_props, 'thread', {
type: Number,
default: 1
}), _props), }), _props),
data: function data() { data: function data() {
@ -824,7 +827,12 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
active: function active(newValue, oldValue) { active: function active(newValue, oldValue) {
if (newValue && !oldValue) { if (newValue && !oldValue) {
this._fileUploads(); for (var i = 0; i < this.thread; i++) {
this._fileUploads();
if (this.mode != 'html5') {
break;
}
}
} }
}, },
uploaded: function uploaded(_uploaded) { uploaded: function uploaded(_uploaded) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -85,6 +85,7 @@ table th,table td {
:accept="accept" :accept="accept"
:multiple="multiple" :multiple="multiple"
:size="size || 0" :size="size || 0"
:thread="thread < 1 ? 1 : (thread > 5 ? 5 : thread)"
:headers="headers" :headers="headers"
:data="data" :data="data"
:drop="drop" :drop="drop"
@ -126,6 +127,11 @@ table th,table td {
Multiple: <input type="checkbox" id="checkbox" v-model="multiple"> Multiple: <input type="checkbox" id="checkbox" v-model="multiple">
</label> </label>
</td> </td>
<td>
<label>
Thread: <input type="text" v-model.number="thread">
</label>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
@ -173,7 +179,7 @@ export default {
title: 'Add upload files', title: 'Add upload files',
drop: true, drop: true,
auto: false, auto: false,
thread: 1,
name: 'file', name: 'file',
postAction: './post.php', postAction: './post.php',

@ -1,7 +1,7 @@
{ {
"name": "vue-upload-component", "name": "vue-upload-component",
"description": "Vue.js file upload component, Support for multiple file uploads, progress, html5, html4, support ie9", "description": "Vue.js file upload component, Support for multiple file uploads, progress, html5, html4, support ie9",
"version": "2.2.0-beta.1", "version": "2.3.0-beta.1",
"author": "LianYue", "author": "LianYue",
"scripts": { "scripts": {
"dev": "webpack-dev-server --inline --hot", "dev": "webpack-dev-server --inline --hot",

@ -97,6 +97,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
thread: {
type: Number,
default: 1,
},
}, },
@ -213,7 +217,12 @@ export default {
active(newValue, oldValue) { active(newValue, oldValue) {
if (newValue && !oldValue) { if (newValue && !oldValue) {
this._fileUploads(); for (var i = 0; i < this.thread; i++) {
this._fileUploads();
if (this.mode != 'html5') {
break
}
}
} }
}, },

Loading…
Cancel
Save