我在我的索引中打开了一个这样的React web应用程序。js文件:
ReactDOM.render(
<React.Fragment>
<Review pplNum={num} />
</React.Fragment>,
document.getElementById('root')
)
然后我希望用户能够关闭它,但关闭按钮不起作用。
以下是审查部分:
import React, { useEffect } from "react";
import axios from 'axios';
const Review = ({ pplNum }) => {
axios.put('/books/reviews/' + pplNum)
.then(res => console.log(res.data));
return (
<div>
<div>Thank you for the review</div>
<div><a href="javascript:window.close">Click here to close</a> this window</div>
</div>
);
}
export default Review;
当我点击它关闭时,什么也没发生。
有什么事情我做得不对吗?
谢谢