定制 deadsimple/vuelidatelibrary 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Stable Version Total Downloads License

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-25