0

This is my template:

<form class="form-inline editableImage" @submit.prevent="upload">
    ...
</form>

This is my script:

methods: {
    upload: function() {
        let data = new FormData();
        data.append('foo', 'bar');
        console.log('data', data);
    }
}

console.log shows:

data FormData {}
    __proto__: FormData

Why is data empty?

0

1 Answer 1

1

Actually, it's not empty. You can check your data by using get(key) method. console.log(data.get('foo')); should show you 'bar'

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.