javascript - [vue] Router.go(-1) is used in business logic to implement page rollback. How to refresh or re-request data from the background after rollback?
迷茫
迷茫 2017-05-19 10:31:55
0
2
817

As the title states, this.$router.go(-1) is used in the business logic to implement rollback, but how to request background data again after rollback?

Currently the logic for requesting background data is written in mounted, but mounted will not trigger when rolling back

  mounted:function(){
     // ajax get 数据
  },
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
習慣沉默

Try adding a timestamp after the request address.

过去多啦不再A梦

can clearly tell you that when calling back, any life cycle callback of the target route will be executed, including mounted.
So you might as well check your code to see if there is any logic problem.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!