VeeValidate Numbers with Decimal Points

In your Vue application, you need to validate the numbers with decimal points. For example, price of a product you can use the following method.

I am using VeeValidate module for this

First you have to install the VeeValidate lib for this

You can run the NPM command to install this

npm install vee-validate --save

First you need to import these libs to your Vue single file component

You need to add following components also

I am going to validate Product Price filed. This is the normal HTML component

Then I can wrap the ValidationProvider as shown in the following code

You can see I have defined the validation rules as shown in the following line

:rules="{required: true, regex: /^\d*\.?\d*$/}"

It says , Purchase Order is required and number with decimal value