在使用 Ant Design 的 flex 类型的行时出现问题,可以尝试以下解决方法:
import 'antd/dist/antd.css';
Row
和 Col
组件:import { Row, Col } from 'antd';
function MyComponent() {
return (
左侧列
右侧列
);
}
flex
属性仍然不按预期工作,可以尝试使用 span
属性来设置列的宽度:
左侧列
右侧列
通过以上方法,可以解决 Ant Design 的 flex 类型的行不按预期工作的问题。如果问题仍然存在,可以进一步检查代码中是否有其他样式或布局相关的问题。