3.10 react 路由链接和普通链接的区别

通过路由链接修改url不会发起http请求

路由链接实际上是利用history对象的push方法/replace方法进行路由跳转(不会发起http请求)

window.location方法进行页面跳转(发起http请求)

通过普通链接修改url会发起http请求

posted @ 2021-03-10 16:15  17135131xjt  阅读(99)  评论(0编辑  收藏  举报