javascript - React Grid列未在列中显示组件
问题描述
我正在学习 react(具有 js/html/css 基础知识),正在练习一些 react 项目。因此,在我的项目中,我需要将一些组件保留在 Grid 列中,并且我希望这些组件按列显示(在我的参考教程中它按预期工作),但我看到它对我来说是按行呈现的。感谢您对此的解释,因为我看到了不同的行为。
版本:语义用户界面反应:“^0.82.1”,反应:“^16.4.1”
import React from 'react';
import { Grid } from 'semantic-ui-react';
import "./App.css";
import ColorPanel from './ColorPanel/ColorPanel';
import SidePanel from './SidePanel/SidePanel';
import Messages from './Messages/Messages';
import MetaPanel from './MetaPanel/MetaPanel';
const App =()=>(
<Grid columns="equal" >
<ColorPanel/>
<SidePanel/>
<Grid.Column style={{marginLeft:320}}>
<Messages/>
</Grid.Column>
<Grid.Column width={4} >
<MetaPanel/>
</Grid.Column>
</Grid>
);
export default App;
我的预期显示:(我没有预期显示的img ref,请原谅。他们只需要在列中)
Colorpanel Sidepanel Messages Metapanel
解决方案
推荐阅读
- terraform - 基于另一个变量的引用变量
- python-3.x - ML 新手第一次尝试使用 SVM 和 SVR 出现一些语法/转置错误
- android - Xamarin Android 应用程序 504 错误
- ios - Flutter Podfile 和 Pods 文件夹未在 ios 目录中创建
- browser-cache - 谷歌页面速度见解上的浏览器缓存。谷歌如何对待私有缓存控制?
- visual-c++ - Visual C++ 看不到我的课程
- javascript - 如何使用 AWS Lambda (javascript) 下载大型 S3 文件
- python - 使用 Boost.Python 嵌入 Python 的 C++
- javascript - 使用 Jquery 使包含 iFrame 的外部 Div 可点击
- angular - 我想在我的欢迎组件上以角度 4 显示登录组件