react和vue中replace()和push()的区别

1.replace()用法:

this.props.history.replace(‘router地址’)
注:replace跳转不会形成history,不可返回到上一层。

2.push()用法

this.props.history.push(‘router地址’)
注:push跳转会形成history,可返回到上一层。

文章内容为原创,如有转载请注明来源(洋葱先生-杨少通: http://www.dreamload.cn/blog/?p=960 )

猜你喜欢

转载自blog.csdn.net/Kindergarten_Sir/article/details/108601351