-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Drawer 打开一个很卡的页面,会卡住没有任何反应需要子页面渲染完了才会展开。 #8723
Comments
Start a new pull request in StackBlitz Codeflow. |
@echoyl |
这个方法没用。现在我就是 setTimeout(() => {
setLoading(false);
}, 10); 先打开drawer再说。虽然也是卡住了,比之前点击按钮没有任何反应的卡住要好一点 |
没用过 const App = () => {
const [open, setOpen] = useState(false);
const [shouldMount, setShouldMount] = useState(false);
const showDrawer = () => {
setOpen(true);
};
const onClose = () => {
setOpen(false);
setShouldMount(false);
};
const CAN_USE = !!shouldMount
return (
<>
<Button type="primary" onClick={showDrawer}>
Open
</Button>
<Drawer
title="Basic Drawer"
loading={CAN_USE === false}
maskClosable={CAN_USE}
keyboard={CAN_USE}
closeIcon={CAN_USE}
// mask={CAN_USE}
afterOpenChange={v => {
console.log('afterOpenChange', v);
if (v) {
setShouldMount(true)
}
}}
onClose={onClose}
open={open}
width={1500}
>
{
shouldMount
? (
<ProForm
request={async () => {
return { columns: [...value, ...value] };
}}
variant="filled"
grid={true}
>
<BetaSchemaForm layoutType="Embed" columns={fieldColumns} />
</ProForm>
)
: null
}
</Drawer>
</>
);
};
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction link
Steps to reproduce
点击open按钮,大概过个3秒才会展开
What is expected?
可以先展开drawer然后里面loading,渲染好了后再展示内容。
What is actually happening?
卡住了
如果使用自带loading属性,貌似也是设置了false后子组件才会真正开始渲染,时间还是不变的
The text was updated successfully, but these errors were encountered: