Socket
Socket
Sign inDemoInstall

form-render-mobile

Package Overview
Dependencies
Maintainers
2
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,常用于自定义搭建配置界面生成


Version published
Weekly downloads
53
decreased by-36.14%
Maintainers
2
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 13 Nov 2023

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