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

form-render-mobile

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-render-mobile

通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成

  • 1.0.16-beta.1
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-57.14%
Maintainers
0
Weekly downloads
 
Created
Source
logo
FormRender Mobile

npm NPM downloads NPM all downloads PRs Welcome

Get started | API | Playground

✨ 简介

FormRender Mobile 是为移动端设置的开箱即用的表单解决方案,通过 JsonSchema 协议动态渲染表单。基于 FormRender2.0Ant Design Mobile 实现。API 与 FormRender2.0 基本一致,如果你熟悉 FromRender2.0 那么你就已经会使用 FormRender Mobile 了。

⚙️ 安装

FormRender Mobile 依赖 Ant Design Mobile,单独使用不要忘记同时安装 antd-mobile

npm i form-render-mobile --save

🚀 快速上手

import React from 'react';
import FormRender, { useForm } from 'form-render-mobile';

const schema = {
  type: 'object',
  displayType: 'row',
  properties: {
    input: {
      title: '输入框',
      type: 'string',
      widget: 'input'
    },
    radio: {
      title: '单选',
      type: 'string',
      widget: 'radio',
      props: {
        options: [
          { label: '早', value: 'a' },
          { label: '中', value: 'b' },
          { label: '晚', value: 'c' }
        ]
      }
    }
  }
};


export default () => {
  const form = useForm();

  const onFinish = (formData) => {
    console.log('formData:', formData);
  };

  return (
    <FormRender 
      form={form} 
      schema={schema} 
      onFinish={onFinish}
    />
  );
}

Keywords

FAQs

Package last updated on 11 Sep 2024

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