react-router – url栏中的重复父路径
发布时间:2020-12-15 09:32:56 所属栏目:百科 来源:网络整理
导读:使用: "react-router": "^2.0.0","react-router-relay": "^0.9.0", 当我在父路径下推送任何链接时,对于每个新的router.push调用,父路径都会在URL栏中重复一次. // http://localhost:3000router.push('auth/profile')// http://localhost:3000/auth/profiler
使用:
"react-router": "^2.0.0","react-router-relay": "^0.9.0", 当我在父路径下推送任何链接时,对于每个新的router.push调用,父路径都会在URL栏中重复一次. // http://localhost:3000 router.push('auth/profile') // http://localhost:3000/auth/profile router.push('auth/profile') // http://localhost:3000/auth/auth/profile router.push('auth/browse') // http://localhost:3000/auth/auth/auth/browse 当我记录位置(来自react-router)时,它不显示重复项.也许浏览器将父路径推送到基本名称? 解决方法
更改
router.push('auth/profile') 至 router.push('/auth/profile') 修好了. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |