【问题标题】:Template string in value attribute值属性中的模板字符串
【发布时间】:2021-03-18 16:23:57
【问题描述】:

我想在 URL 中保留参数以在刷新页面后保持状态,我尝试实现类似:

<Link to="/estimates/edit/${estimateId}?name=review-information"></Link>

但它似乎不起作用,知道如何将“复杂”字符串传递给to 属性吗?

【问题讨论】:

    标签: reactjs react-router router


    【解决方案1】:

    你可以试试这个:

    <Link to={`/estimates/edit/${estimateId}?name=review-information`}></Link>
    

    【讨论】:

      猜你喜欢
      • 2022-01-03
      • 2021-05-23
      • 2023-01-27
      • 2019-08-12
      • 2021-11-23
      • 2016-01-16
      • 1970-01-01
      • 2021-08-12
      • 1970-01-01
      相关资源
      最近更新 更多