一、路由返回页面未刷新的解决方法
(uniapp/小程序):
1.使用this.$forceUpdate()
-------------路由返回方法调用之后------------
this.$forceUpdate()
2.前者不起作用的时候,就获取上页面的实例来调用相关方法
-------------路由返回方法调用之后------------
// 调用上一页面的方法刷新上一页数据
// eslint-disable-next-line no-undef
const pages = getCurrentPages() // 当前页面
const beforePage = pages[pages.length - 2] // 上一页
beforePage.$vm.getData() //getData()上页面请求接口的方法,beforePage中可以直接调用onload等方法
(web):
web可以使用 window.location.reload()
uniapp可以在onload使用location.reload()
小程序则不起作用