Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array 支持 extra 属性 #1337

Open
leshalv opened this issue Jul 6, 2023 · 0 comments
Open

array 支持 extra 属性 #1337

leshalv opened this issue Jul 6, 2023 · 0 comments
Assignees

Comments

@leshalv
Copy link
Contributor

leshalv commented Jul 6, 2023

image
import React from "react";
import FormRender, { Schema, useForm } from "form-render";

const schema: Schema = {
  type: "object",
  displayType: "row",
  properties: {
    redirectUris: {
      type: "array",
      title: "登录 Redirect URI",
      extra:
        "Redirect URI 白名单,应用在请求登录时携带 redirect_uri 参数,该值需要在白名单中,IAM 才会在认证完成后发起跳转。若有多条,请点击添加进行扩展",
      widget: "simpleList",
      display: "inline",
      min: 1,
      props: {
        hideMove: true,
        hideCopy: true
      },
      items: {
        type: "object",
        properties: {
          input: {
            bind: "root",
            type: "string",
            rules: [
              {
                type: "url",
                message: "Redirect URI 格式不正确"
              },
              {
                required: true,
                message: "请配置登录 Redirect URI"
              }
            ]
          }
        }
      }
    }
  }
};

const Demo = () => {
  const form = useForm();

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

  return (
    <FormRender
      form={form}
      schema={schema}
      onFinish={onFinish}
      footer={true}
      labelCol={{ span: 5 }}
      wrapperCol={{ span: 19 }}
    />
  );
};

export default Demo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants