Skip to content

Latest commit

 

History

History
117 lines (82 loc) · 3.86 KB

File metadata and controls

117 lines (82 loc) · 3.86 KB

el-semver-input

Build Status NPM Download NPM Version NPM License PRs Welcome Automated Release Notes by gren

语义化版本输入框:失去焦点可以补全。

Introduction

What is el-semver-input

el-semver-input组件基于el-input,在保留了el-input原本的属性以及方法的基础上进行了拓展,对输入值的格式进行校验,并可以自动修正错误输入。

Why

使用el-semver-input,您将享受到以下便捷之处:

  • 上手简单,默认开启全部功能
  • 可自定义格式检验规则
  • 可自定义自动填充规则

Table of Contents

Feature

  • 可选是否携带 v 前缀
  • 阻止不合法字符串输入
  • 可根据默认或自定义的规则进行自动填充
  • 失去焦点时格式错误重置为默认值
  • 自定义检验规则,自动填充规则
  • 根据匹配到的规则尝试自动修复

⬆ Back to Top

Documentation

⬆ Back to Top

Pre Install

# 确保提前安装了element-ui
yarn add element-ui

# 且全局注册了el-input

Quick Start

# Step1 安装
yarn add @femessage/el-semver-input
// Step2 在需要的.vue 文件中
<template>
  <el-semver-input v-model="version" />
</template>
<script>
import ElSemverInput from 'el-semver-input'
export default {
  components: {
    ElSemverInput
  },
  data() {
    return {
      version: ''
    }
  }
}
</script>

⬆ Back to Top

Example

  • 自动修复

  • 自定义自动填充规则

  • 阻止不合法的输入

⬆ Back to Top

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

⬆ Back to Top