我正在一个react.js项目上,该项目需要一个图像按钮或一个输入到React Router链接的输入,但我似乎找不到解决方法。
这是我的代码:
render: function() {
return (
<div className="Item" style={{backgroundImage: 'url(' + this.props.poster + ')'}} >
<div className="overlay">
<div className="title">{this.props.title}</div>
<div className="rating">{this.props.score} / 10</div>
<div className="plot">{this.props.overview}</div>
<div className="play"><input className="button" type="image" src="www.url.to/the/image"></input></div>
<Link to={`/${this.props.id}`} id="link"/>
<ListToggle />
</div>
</div>
);
}
Run Code Online (Sandbox Code Playgroud) I'm creating a program for a robot to map out a labyrinth. I'm doing this in Python and the problem is when I'm trying to create a 3D array with my objects by looping through it, somehow every object gets populated with [9, 9, 2].
class Field:
coordinates = {}
def __init__(self, x_arg, y_arg, z_arg = None):
self.coordinates['x'] = x_arg
self.coordinates['y'] = y_arg
if z_arg is not None:
self.coordinates['z'] = z_arg
else:
self.coordinates['z'] = 0
def update_location(self, x_arg, y_arg, z_arg …Run Code Online (Sandbox Code Playgroud)