public v$: Validation<ValidationArgs, ExtractState<FormData>>
constructor(rules: ValidationArgs, formData: ExtractState<object>) {
this.v$ = useVuelidate<ValidationArgs, ExtractState<FormData>, ValidationArgs>(
rules as ValidationArgs,
formData as unknown as Record<string, any>
) as unknown as Validation<ValidationArgs, ExtractState<FormData>>
}
public v$: Ref<Validation<object, Ref<object>>>
constructor(rules: object, formData: Ref<object>) {
this.v$ = useVuelidate(rules, formData)
}
const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: (config) => {
const devWatchOptions = {
aggregateTimeout: 200,
poll: 100,
ignored: ['node_modules']
}
const renderWatchOptions = () => process.env.NODE_ENV === 'development' ? devWatchOptions : {}
config.watchOptions = renderWatchOptions()
}
})
// Комонент
const getResponseField = computed(() => {
return responseField.value
})
...useManualForm(getResponseField.value)
// Вызываемая функция
watch(fields, () => {
fields.forEach((field) => {
formData[field.name] = '1'
})
})
const handleClick = (event: Event) => {
const target = event.target as Element
if (target.closest('button') || target.closest('.contact')) return
emit('close')
}
useHandleClick(handleClick)
return {
contact
}