arco-design-mobile
arco-design-mobile copied to clipboard
[Picker] 首次渲染 `renderLinkedContainer` 函数中的`data`为空
- [ ] I'm sure this does not appear in the issue list of the repository
Basic Info
- Package Name And Version: @arco-design/[email protected]
- Phone Model And Version: *
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为空