laracasts / Vue-Forms

https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19
396 stars 204 forks source link

array values got error #17

Closed sciracioglu closed 6 years ago

sciracioglu commented 6 years ago

when form posted return error. because form has array object.

how can i change this function ?

`reset() { for (let field in this.originalData) { this[field] = ''; }

    this.errors.clear

image (); }`

AndrewMast commented 6 years ago

Use this as your reset function: (note that when creating the Form instance, make sure you pass an array as the original data)

reset() {
    for (let field in this.originalData) {
        this[field] = this.originalData[field];
    }

    this.errors.clear();
}
sciracioglu commented 6 years ago

thanks