const formsMixin = { methods : { handleFormRequestError ( err , formFields ) { const data = err . response . data ; if ( data . invalidFields ) { for ( const field of data . invalidFields ) { const fieldIndex = formFields . findIndex ( ( f ) => f . fieldKey === field . name ) ; formFields [ fieldIndex ] . error = field . error . replace ( field . name , formFields [ fieldIndex ] . name ) ; } ( this as any ) . $forceUpdate ( ) ; } return formFields ; } , resetErrors ( formFields ) { return formFields . map ( field => { delete field . error ; return field ; } ) ; } } } ; export default formsMixin ;