reactjs - 如何在点击时重定向到外部网址?反应
问题描述
我正在使用 react-router 女巫意味着我将路由存储在 app.tsx 文件中。
我有卡片组件需要在点击时重定向到外部 url。
所以我的问题是如何使用外部 url 示例重定向点击卡片组件:www.test.com并向该 url 提供两个查询字符串 a=xxx b=xxx。
解决方案
那是你需要的吗?
const onClick = () => {
location.href = 'http://<location>/?a=1';
}
推荐阅读
- discord - 当我试图制作我的不和谐机器人时,它给了我这个错误
- java - 为什么在 Step 中将 TransactionManager 设置为 JPATransactionManager 不正确?
- amazon-web-services - 使用无服务器有条件地为 lambda 设置预置并发
- postgresql - 使用 CTE 进行多次更新
- vue.js - 来自商店的计算属性不触发更改或观察者
- c - Clion在文本文件中读/写
- reactjs - MobX 和 Next.js(快速刷新)
- amazon-web-services - 雪花日期列的 AVRO 文件日期不正确
- javascript - 处理标签的简单条件(JQuery,javascript)
- c++ - 在他的调用者完成工作后线程会死吗?