javascript - 我如何在反应中使用 2 个组件,一个到另一个?
问题描述
我需要使用两个组件,其中一个位于另一个下方,并且我需要与这两个组件进行交互。更具体地说,我需要使用 react-particles-js 模块,但我无法与之交互。我已经尝试使用 css z-index 属性,但它不起作用。
import Particles from 'react-particles-js'
import Screens from './screens'
...
class App extends Component {
render() {
return (
<div>
<Screens /> //this component has all screens of my application, and i use zIndex:'1' into Inputs, TextFields, Buttons and others components of Semantic UI...
<Particles
params={params}
style={{ position: 'absolute', top: '0', zIndex: '0' }}
/>
</div>
)
}
}
class ScreensLogin extends Component {
...
<Form.Group>
<Form.Input
style={{ marginBottom: '28px', zIndex: '1' }}
onChange={this.handleChange("email")}
autoComplete="on"
type='text'
name='email'
placeholder='Email'
icon='mail'
iconPosition='left'
width={16}
id='fieldEmail'
/>
</Form.Group>
我必须对此代码做什么才能正常工作?
解决方案
推荐阅读
- sql - 根据特定字段中的重复值删除整个记录
- c# - 为什么图片框中没有显示图像?
- python - 无法安装旧版本的 tensorflow:没有找到 tensorflow==1.9.0 的匹配分布
- android - RecyclerView 未显示列表,但数据正在馈送到适配器
- java - Java:两个过滤问题
- c++ - 不能将字符串数组声明为类成员而不是 char (C++)
- office-scripts - 如何在 Office 脚本中调用另一个脚本?
- c# - 在.Net Core 3.1 App中重定向程序集
- c - 当我插入(> 2000000)时合并排序,它将显示“分段错误(核心转储)”。但我已经使用了动态数组
- angular - 如何处理 Angular 中的通用路由?