vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

Property defineField does not exist in useForm()

Open ahmaruff opened this issue 1 year ago • 0 comments

What happened?

I use nuxt3 and install vee-validate with pnpm add @veevalidate/nuxt

I want to use Composition API (because I use 3rd party UI library). and I following example in https://vee-validate.logaretm.com/v4/.

when i try to use defineField,

const {values, defineField} = useForm();

it return error

Property 'defineField' does not exist on type 'FormContext<GenericObject, GenericObject>'.

can somebody explain why?

Reproduction steps

  1. install vee-validate
  2. create pages
  3. write const {values, defineField} = useForm(); ...

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • [ ] Firefox
  • [X] Chrome
  • [ ] Safari
  • [ ] Microsoft Edge

Relevant log output

[{
	"resource": "/home/ahmaruff/work/waktoo/fe/ecomm-fe/.app/pages/auth/login.vue",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "2339",
	"severity": 8,
	"message": "Property 'defineField' does not exist on type 'FormContext<GenericObject, GenericObject>'.",
	"source": "ts",
	"startLineNumber": 14,
	"startColumn": 9,
	"endLineNumber": 14,
	"endColumn": 20
}]

Demo link

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ahmaruff avatar Mar 25 '24 09:03 ahmaruff