options prop is converted to configurations data variable and maxFiles control is fixed #1807
This commit is contained in:
parent
7fe64cd829
commit
3cfda098da
@ -86,6 +86,7 @@ export default {
|
|||||||
currentFile: null,
|
currentFile: null,
|
||||||
files: [],
|
files: [],
|
||||||
showList: false,
|
showList: false,
|
||||||
|
configurations: this.options,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -94,12 +95,12 @@ export default {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let preview = !this.multiple ? this.$refs.previewSingle : this.$refs.previewMultiple;
|
let preview = !this.multiple ? this.$refs.previewSingle : this.$refs.previewMultiple;
|
||||||
|
|
||||||
if (!this.options.maxFiles && !this.multiple) {
|
if (this.configurations.maxFiles === undefined && this.multiple == false) {
|
||||||
this.options['maxFiles'] = 1;
|
this.configurations.maxFiles = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalOptions = {
|
let finalOptions = {
|
||||||
...this.options,
|
...self.configurations,
|
||||||
url: this.url,
|
url: this.url,
|
||||||
thumbnailWidth: null,
|
thumbnailWidth: null,
|
||||||
thumbnailHeight: null,
|
thumbnailHeight: null,
|
||||||
@ -111,7 +112,7 @@ export default {
|
|||||||
this.on('addedfile', function (file) {
|
this.on('addedfile', function (file) {
|
||||||
self.files.push(file);
|
self.files.push(file);
|
||||||
|
|
||||||
if (self.options.maxFiles == 1) {
|
if (self.configurations.maxFiles == 1) {
|
||||||
self.$emit('change', file);
|
self.$emit('change', file);
|
||||||
} else {
|
} else {
|
||||||
self.$emit('change', self.files);
|
self.$emit('change', self.files);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user