npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zl-form

v0.0.1

Published

Form组件

Downloads

2

Readme

zl-form

Form组件

使用代码示例:

<div style={{width: '80%', border: '1px solid #d4d4d4', marginBottom: '16px', padding: '8px'}}>
    <Form layout='vertical' onSubmit={e => this.onSubmit(e)}>
        <FormItem label={'手机号'} require={true} colon={true}>
            {getFieldDecorator('phone', {
                initialValue: '18895462994',
                rules: [
                    { required: true, message: '必填' },
                    { max: 18, message: '请勿输入大于10的'},
                    { min: 2, message: '请勿输入小于2的'},
                    {
                        pattern: new RegExp('^1\\d{10}$'),
                        message: '请输入正确格式的手机号'
                    }
                ]
            })(
                <Input placeHolder={'请输入你的手机号'}/>
            )}
        </FormItem>
        <FormItem label={'姓名'} require={true} colon={true}>
            {getFieldDecorator('name', {
                initialValue: '王安妮',
            })(
                <Select placeHolder="请选择你的姓名">
                    <OptionItem itemKey="王安妮" itemValue="王安妮">王安妮</OptionItem>
                    <OptionItem itemKey="何佳欢" itemValue="何佳欢">何佳欢</OptionItem>
                    <OptionItem itemKey="蒋英浩" itemValue="蒋英浩">蒋英浩</OptionItem>
                    <OptionItem itemKey="韦丹" itemValue="韦丹">韦丹</OptionItem>
                </Select>
            )}
        </FormItem>
        <FormItem label={'是否是女生'} require={true} colon={true}>
            {getFieldDecorator('isWoman', {
                initialValue: true
            })(
                <CheckBox defaultValue={true} type={"single"}/>
            )}
        </FormItem>
        <FormItem>
            <Button htmlType='submit' type='primary'>提交</Button>
        </FormItem>
    </Form>
</div>

<div style={{width: '80%', border: '1px solid #d4d4d4', marginBottom: '16px', padding: '8px'}}>
    <Form layout='horizontal'>
        <FormItem label={'姓名'} require={true} colon={true}>
            {getFieldDecorator('name', {
                initialValue: '安妮'
            })(
                <Input placeHolder={'请输入你的名字'}/>
            )}
        </FormItem>
        <FormItem label={'性别'} require={true} colon={true}>
            {getFieldDecorator('name', {
                initialValue: '我是女生啦啦啦'
            })(
                <Input placeHolder={'请输入你的性别'}/>
            )}
        </FormItem>
    </Form>
</div>

<div style={{width: '80%', border: '1px solid #d4d4d4', marginBottom: '16px', padding: '8px'}}>
    <Form layout='inline'>
        <FormItem label={'姓名'} require={true} colon={true}>
            {getFieldDecorator('name', {
                initialValue: '安妮'
            })(
                <Input placeHolder={'请输入你的名字'}/>
            )}
        </FormItem>
        <FormItem label={'请选择你的性别'} require={true} colon={true}>
            {getFieldDecorator('name', {
                initialValue: '我是女生啦啦啦'
            })(
                <Input placeHolder={'请输入你的性别'}/>
            )}
        </FormItem>
    </Form>
</div>

alt jpg

Form

| 参数 | 说明 | 类型 | | :--- | :--- | :--- | | form | 经 Form.create() 包装过的组件会自带 this.props.form 属性 | object | | layout | 表单布局,默认inline | 'horizontal','vertical','inline' | | onSubmit | 数据验证成功后回调事件 | Function(e:Event) |

Form.Item

| 参数 | 说明 | 类型 | | :--- | :--- | :--- | | form | 经 Form.create() 包装过的组件会自带 this.props.form 属性 | object | | required | 是否必填 | boolean | | label | label 标签的文本 | string | | colon | 配合 label 属性使用,表示是否显示 label 后面的冒号 | boolean |