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

🧐[问题] ProLayout actionsRender 样式异常 #7867

Closed
Arispex opened this issue Nov 7, 2023 · 1 comment
Closed

🧐[问题] ProLayout actionsRender 样式异常 #7867

Arispex opened this issue Nov 7, 2023 · 1 comment

Comments

@Arispex
Copy link

Arispex commented Nov 7, 2023

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

当 ProLayout 的 layout 为 side 时,actionsRender 内的 Ant Design 组件显示异常

💻 示例代码

import {ProLayout} from "@ant-design/pro-components";
import {Button, Switch} from "antd";

function App() {
  return (
      <ProLayout
          layout={"top"}
          actionsRender={(props) => {
            return[
                <Switch checkedChildren={"开"} unCheckedChildren={"关"}></Switch>,
                <Button>注册</Button>
            ]
          }}
      >
        
      </ProLayout>
  );
}

🚑 其他信息

Ant Design Pro Components 和 Ant Design 均为最新版

CleanShot 2023-11-07 at 14 27 36@2x
CleanShot 2023-11-07 at 14 27 28@2x

@chenshuai2144
Copy link
Contributor

通过查看您提供的示例代码和截图,可以看出您在使用ProLayout组件时遇到了问题。根据您的描述,当layout属性设置为"side"时,actionsRender内的Ant Design组件显示异常。

根据您提供的信息,可以猜测问题可能是样式编译报错导致的。您可以尝试以下解决方法:

  1. 确保您的Ant Design Pro Components和Ant Design都是最新版本,以避免已知的样式问题。
  2. 检查您的代码中是否存在其他样式相关的问题,例如重复的样式引入或冲突的样式定义。
  3. 尝试在ProLayout组件外部使用Ant Design组件,检查它们是否正常显示。这样可以帮助确定是ProLayout组件还是Ant Design组件本身的问题。

如果上述方法无法解决问题,建议您将更详细的错误信息提供出来,例如控制台报错信息,以便我们能够更准确地帮助您解决问题。同时,您可以将该问题提交到Ant Design的GitHub仓库,以获得更多开发者的帮助和关注。

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