【问题标题】:unexpected string concatenation of literals react.js文字的意外字符串连接react.js
【发布时间】:2022-10-25 14:12:23
【问题描述】:
 to={routeName.tutorClassView + '?classId=' + `${_.get(value, '_id')}`}

 to={routeName.tutorClassView + '?classId=' + `${_.get(v, 'id')}` + '&providerId=' + `${_.get(v, 'provider.id')}`}

我在这里做错了什么

【问题讨论】:

  • 你要做什么? routeName.tutorClassView 的值是多少?

标签: reactjs concatenation


【解决方案1】:

您可以像这样使用模板字符串文字

to={`routeName.tutorClassView?classId=${_.get(value, '_id')}`}

【讨论】:

    猜你喜欢
    • 2019-08-02
    • 1970-01-01
    • 2023-03-26
    • 1970-01-01
    • 2018-06-21
    • 1970-01-01
    • 1970-01-01
    • 2021-12-27
    • 1970-01-01
    相关资源
    最近更新 更多