Extract max file size so it can be computed later.
This commit is contained in:
parent
5b6433cb1c
commit
1a15105bdc
1 changed files with 7 additions and 2 deletions
|
|
@ -159,9 +159,8 @@ export default {
|
|||
},
|
||||
|
||||
isImageValid(imageFile) {
|
||||
let maxSize = 0.5 * 1028 * 1028;
|
||||
|
||||
return imageFile && imageFile.size < maxSize;
|
||||
return imageFile && imageFile.size < this.maxFileSize;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -200,6 +199,12 @@ export default {
|
|||
return questionText;
|
||||
},
|
||||
},
|
||||
|
||||
maxFileSize() {
|
||||
let kiloBytes = 512;
|
||||
|
||||
return kiloBytes * 1028;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
async value(newValue) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue