我在 React 项目上做了一个仪表板。所有的东西都工作正常,但是当我在测试服务器上上传项目时,一些链接显示 404 错误(https://i.imgur.com/tIxkzrb.png)。
这是给出 404 错误的链接的屏幕截图 ( https://i.imgur.com/Y4wUGOn.png )。当我单击编辑链接时,它显示 404 错误。
这是我的客户组件的路由。
<div className="col-md-12 bg-gray" style={padding}>
<div className="row" style={row}>
<h3 className="paragraph mgb-30 roboto">Customers</h3>
</div>
<Switch>
<Route path="/dashboard/customers" exact component={CustomerTable} />
<Route path="/dashboard/customers/list" component={CustomerTable} />
<Route path="/dashboard/customers/add" component={AddCustomer} />
<Route path="/dashboard/customers/update" component={UpdateCustomer} />
</Switch>
</div>
这是 CustomerTable 的代码
<td className="customer-action relative">
<i className="fa fa-ellipsis-v customer-icon"></i>
<span className="customer-detail-container">
<ul className="list customer-detail-list">
<li><Link to="/dashboard/customers/update" className="normal-link"><img src={Eye} alt="Edit customer" style={icon} />Edit</Link></li>
<li onClick={this.showAlert}><img src={Download} alt="Delete customer" style={icon} />Delete</li>
</ul>
</span>
</td>
这实际上是我在使用 jQuery 时做出的一个下拉列表。最初,它具有display: none. 当我点击图标时,它的显示变成了一个块。