deadsimple/vuelidatelibrary
最新稳定版本:1.0.2
Composer 安装命令:
composer require deadsimple/vuelidatelibrary
包简介
A deadsimple module to use Vuelidate in your Modern Magento 2 Vue Projects
README 文档
README
Deadsimple Vuelidate Magento2 Composer Library
Implement modern form validation to your Magento 2 VueJS forms using vuelidate
Installation
Use composer to install the module: composer require deadsimple/vuelidatelibrary
Usage
To use Vuelidate you will need to load the Vuelidate library and it's Validators using the Magento 2 requirejs methods. Select the neccesary mixin and the validators you would like to use with the destructure syntax. Load the mixin like any other mixins and start using Vuelidate as described in it's documentation.
define([
'Vue',
'Vuelidate',
'VuelidateValidators',
], function (Vue, Vuelidate, validators) {
const {validationMixin} = Vuelidate;
const {required, email } = validators;
Vue.component('contactForm', {
template: template,
mixins: [ validationMixin ],
data() {
return {
name: null,
email: null,
}
},
validations(){
name: { required },
email: { required, email }
}
})
})
Version
This library loads: Vuelidate v0.7.5
统计信息
- 总下载量: 4.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-25