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

[Picker] 首次渲染 renderLinkedContainer 函数中的data为空 #293

Open
1 task
canvascat opened this issue Oct 21, 2024 · 0 comments
Open
1 task

Comments

@canvascat
Copy link

Basic Info

import React from "react";
import { Picker } from "@arco-design/mobile-react";

const options = [
  { label: "male", value: "1" },
  { label: "female", value: "2" },
  { label: "others", value: "3" },
];

export default function FormDemo() {
  const [value, setValue] = React.useState(["1"]);
  return (
    <Picker
      value={value}
      onChange={setValue}
      renderLinkedContainer={(value, data) => {
        console.debug(value, data);
        return (
          <div
            className="arco-form-picker-link-container"
            style={{ width: 240, height: 30, border: "1px solid #ccc" }}
          >
            {data.map((item) => item.label).join(",")}
          </div>
        );
      }}
      cascade={false}
      data={options}
      maskClosable
    />
  );
}

在有初始值的情况下,显示data为空
image

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

1 participant