optional chaining
This commit is contained in:
parent
0fc8eec293
commit
5ea3d462b9
34 changed files with 68 additions and 77 deletions
|
|
@ -50,7 +50,7 @@ const ImageCropper = {
|
|||
},
|
||||
readFile() {
|
||||
const fileInput = this.$refs.input
|
||||
if (fileInput.files != null && fileInput.files[0] != null) {
|
||||
if (fileInput?.files?.[0]) {
|
||||
this.file = fileInput.files[0]
|
||||
const reader = new window.FileReader()
|
||||
reader.onload = (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue