Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alitajs/dform

Package Overview
Dependencies
Maintainers
6
Versions
349
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alitajs/dform

## 表单组件

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
218
increased by2.83%
Maintainers
6
Weekly downloads
 
Created
Source

移动端的表单方案

表单组件

封装常用的表单组件,将 antd-mobile 的组件,改成受控组件。

官方用法

<InputItem
    {...getFieldProps('autofocus')}
    clear
    placeholder="auto focus"
    ref={el => this.autoFocusInst = el}
    >标题</InputItem>

使用@alitajs/dform

<NomarInput
    name='autofocus'
    placeholder="auto focus"
    title='标题'
    />

动态表单

<List renderHeader={() => 'Customize to focus'}>
    <InputItem
        {...getFieldProps('autofocus')}
        clear
        placeholder="auto focus"
        ref={el => this.autoFocusInst = el}
        >标题</InputItem>
    <Picker extra="请选择(可选)"
        data={district}
        title="Areas"
        {...getFieldProps('district', {
            initialValue: ['340000', '341500', '341502'],
            rules: [{ required:true, message: `请输入${title}` }],
        })}
        onOk={e => console.log('ok', e)}
        onDismiss={e => console.log('dismiss', e)}
        >
          <List.Item arrow="horizontal">Multiple & cascader</List.Item>
    </Picker>
</List>

使用@alitajs/dform

const formData = [
    {
      type: 'input',
      fieldProps: 'autofocus',
      required: true,
      placeholder: 'auto focus',
      title: '标题',
      inputType: 'text',
    },
    {
      type: 'select',
      fieldProps: 'district',
      required: true,
      placeholder: '请选择(可选)',
      title: 'Multiple & cascader',
      data: district,
    }
];
<DynamicForm data={formData} />

可视化编辑方案

方案灵感来源于 avaautoChart,用法和触发条件一致,都是data为空且在开发状态的时候,显示编辑表单按钮。用户可以强制设定 isDev 来在任意环境中使用。

2020-01-20 17 16 23

更多详情,请点击dform官网 欢迎交流。感谢!

FAQs

Package last updated on 20 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc