创建了一个目录,当您单击“更多信息”按钮时,会弹出一个模态。弹出,但是图像和描述未显示在弹出模式中
let { itemInfo } = this.props;
let removeCom;
if (itemInfo.description) {
removeCom = itemInfo.description
.replace("?", "")
.replace('<td width="110" height="">', "")
.replace("http://extranet.acetools.com/Catalog/",
"assets/img/items/")
.replace((/<INPUT[^>]*>/gmi), "")
.split('<CENTER><FONT COLOR="RED">', 1);
console.log(removeCom);
}
return (
<h6 className="card-header" style={cardHeader}>
Item # {this.props.itemInfo.item_no} - {this.props.itemInfo.item}
</h6>
<div className="card-body" style={cardBody}>
<div className="row">
<div className="col-6" dangerouslySetInnerHTML={{__html:
removeCom}} style={text}>
</div>
<div className="col-6">
<img src={this.props.itemInfo.image} alt="" style= .
{productImg}></img>
</div>
{/* <div>hello</div> */}
</div>
<div className="row">
<button className="btn btn-outline-primary" onClick= .
{this.props.onClose} style={closeButton}>
Close
</button>
答案 0 :(得分:0)
很幸运,请查看以下示例:
import { Button, Text, View } from 'react-native'
class ErrorModal extends React.Component {
render() {
const { modal: { closeModal, params } } = this.props
return (
<View>
<Text>An error occured!</Text>
<Text>{params.errorMessage}</Text>
<Button onPress={closeModal} title="OK" />
</View>
)
}
}
export default ErrorModal
检查是否通过解构传递道具并检查路线。我希望这会有所帮助。