uniapp返回列表,列表页面数据不刷新

返回上一页,页面刷新

motheds:{
    // 编辑

            submitEdmit() {
                        let pages = getCurrentPages(); // 当前页面
                        let prePage = pages[pages.length - 2]; // 上一页
                        prePage.$vm.list()//调用上一页方法getList()

                    uni.switchTab({
                            url:"/pages/index/index"
                        })
                }
}

tabber跳转,页面刷新

            submit() {
                        uni.switchTab({
                            url: '/pages/index/index',
                            success: function(e) {
                                // pop() 方法用于删除数组其他元素并返回数组的最后一个元素
                                let currentPage = getCurrentPages().pop(); //当前页面
                                if (currentPage == undefined || currentPage == null) return;
                                currentPage.onLoad(); //页面存在刷新当前页面
                                //currentPage.onShow()
                                //currentPage.onReady()
                                // 或者执行其他生命周期刷新
                            }
                        })
                }

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值