1
0
mirror of synced 2024-11-29 00:26:12 +03:00

fix: Typehint fixes

This commit is contained in:
Zaytsev Kirill 2020-10-20 17:41:28 +03:00
parent ca292960ff
commit d1a0986ba4
4 changed files with 7 additions and 3 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ coverage
.vscode .vscode
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
*.dev.tale.vue
*.dev.stories.js

View File

@ -167,7 +167,7 @@ export default class Formulario {
* Given an array, this function will attempt to make sense of the given error * Given an array, this function will attempt to make sense of the given error
* and hydrate a form with the resulting errors. * and hydrate a form with the resulting errors.
*/ */
handle (error: any, formName: string, skip: boolean = false) { handle (error: any, formName: string, skip = false) {
// @ts-ignore // @ts-ignore
const e = skip ? error : this.options.errorHandler(error, formName) const e = skip ? error : this.options.errorHandler(error, formName)
if (formName && this.registry.has(formName)) { if (formName && this.registry.has(formName)) {
@ -184,7 +184,7 @@ export default class Formulario {
/** /**
* Reset a form. * Reset a form.
*/ */
reset (formName: string, initialValue: Object = {}) { reset (formName: string, initialValue: Record<string, any> = {}) {
this.resetValidation(formName) this.resetValidation(formName)
this.setValues(formName, initialValue) this.setValues(formName, initialValue)
} }

View File

@ -18,6 +18,8 @@ import Registry from '@/libs/registry'
import FormSubmission from '@/FormSubmission' import FormSubmission from '@/FormSubmission'
import FormularioInput from '@/FormularioInput.vue' import FormularioInput from '@/FormularioInput.vue'
import { ErrorObserver } from '@/validation/types'
@Component({ name: 'FormularioForm' }) @Component({ name: 'FormularioForm' })
export default class FormularioForm extends Vue { export default class FormularioForm extends Vue {
@Provide() formularioFieldValidation (errorObject): void { @Provide() formularioFieldValidation (errorObject): void {

View File

@ -63,7 +63,7 @@ export default class FormularioInput extends Vue {
@Prop({ @Prop({
type: [String, Boolean, Array], type: [String, Boolean, Array],
default: false, default: false,
}) validation }) validation!: string|any[]|boolean
@Prop({ @Prop({
type: [String, Boolean], type: [String, Boolean],