0.1.0 • Published 5 years ago

form-check-input v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

form-check-input

这是一个可以自定义检查格式,显示清除按钮,显示密码的输入框。

demo

都说表单是前端的CRUD

DEMO

引入项目

  1. 通过<script>标签引入
download from https://github.com/Alfxjx/form-check-input/releases

<script src="index.min.js"></script>
// or
<script src="index.js"></script>
  1. 通过npm install引入
npm install form-check-input

import { init } from 'form-check-input'
  1. 通过CDN引入
<script src="https://unpkg.com/form-check-input/release/index.min.js"></script>
// or
<script src="https://unpkg.com/form-check-input/release/index.js"></script>

快速上手

本项目选择 formCheck 作为对象

formCheck.init(id,{
  showClear: true,
  type: 'Email'
});

需要挂在一个id为${id}的form节点上:

<form id="{{id}}"></form>

官方文档

Gitbook 主要包括使用说明以及二次开发的一些帮助

NPM npmjs上面的信息。

API

name 名称type 类型default 默认值describe 描述
langStringcn语言,目前支持中文
showClearBooleanfalse全部清除按钮
showEyeBooleanfalse显示密码按钮
showHintBooleanfalse显示输入结果的提示行
showHelpBooleanfalse显示输入内容提示
showAutofixBooleanfalse自动补全
placeholderStringplease input占位文字
isMustBooleanfalse是否是必填项(*)
mustPositionStringleftleft/right,设置星号位置。
typeString/需要检查的格式类型
userPasswordRegex/自定义密码的匹配格式
withdefaultCSSBooleantrue是否添加默认样式(Bootstrap)

Issues

请在本项目的issues里面提问。

提问时建议加上TAG

在 Vue.js 中使用

<form id='input'></form>

import { init } from 'form-check-input';

export default {
	// ...
	mounted() {
		init('input', { 
      type: 'phone', 
      showHint: true, 
      showClear: true, 
      showEye: true 
    });
	},
	// ...
};

在 React.js 中使用

测试功能

首先需要安装http-server

npm install http-server -g
npm run example

打开 此链接,查看实例功能。

TODO

  • showClear
  • isMust & mustPosition
  • showEye
  • change svg when password is unshown.
  • showHint & showHelp & showAutofix
  • userPassword

About/关于

  • Alfxjx
  • 24岁,是学生。
  • 待业,想找一个实习
0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago