1
0
mirror of synced 2024-11-22 05:16:05 +03:00

Merge pull request #8 from cmath10/fix-types

fix: Typehint fixes
This commit is contained in:
Kruglov Kirill 2020-10-21 10:57:26 +03:00 committed by GitHub
commit 9aedaa1b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ coverage
.vscode
*.sublime-project
*.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
* 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
const e = skip ? error : this.options.errorHandler(error, formName)
if (formName && this.registry.has(formName)) {
@ -184,7 +184,7 @@ export default class Formulario {
/**
* Reset a form.
*/
reset (formName: string, initialValue: Object = {}) {
reset (formName: string, initialValue: Record<string, any> = {}) {
this.resetValidation(formName)
this.setValues(formName, initialValue)
}

View File

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

View File

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