davestewart / vee-element

Replaces Element UI's validation engine with Vee Validate
http://vee-element.netlify.com
MIT License
73 stars 8 forks source link

Vee-Validate Locale #25

Open mfrankhuizen93 opened 5 years ago

mfrankhuizen93 commented 5 years ago

Love the plugin!

However when trying to use the locale files of Vee-Validate the {field} is not replaced by the field name.

Input field

<el-form-item :required="true" :label="$t('create.name')" prop="name" >
    <el-input v-model="formData.name"/>
</el-form-item>

[...] 

rules: {
    name: 'required|min:3',
}

Main.js

import nl from 'vee-validate/dist/locale/nl'; 
import VeeValidate from "vee-validate";
import VeeElement from "vee-element";

[...] 

const Validator = new VeeValidate.Validator({}, {});

Validator.localize('nl', nl);

Result

{field} is verplicht
{field} moet minimaal 3 karakters zijn

Did I make a mistake or is it just not possible?

whoisarpit commented 4 years ago

@mfrankhuizen93 I believe this has been fixed now. Please check if still relevant.