x-render icon indicating copy to clipboard operation
x-render copied to clipboard

array 支持 extra 属性

Open leshalv opened this issue 2 years ago • 0 comments

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;


leshalv avatar Jul 06 '23 15:07 leshalv