1***@qq.com
1***@qq.com
  • 发布:2020-07-18 16:21
  • 更新:2020-07-18 16:31
  • 阅读:868

使用 在 onshow 调用 createSelectorQuery ,跳转到下一个页面 ,刷新后返回,createSelectorQuery 查询不到节点写信

分类:uni-app

在 a 页面 加载 ,正常进入科技获取到
跳转到 b页面后 刷新b页面 返回 a页面 查询返回 undefined

onShow(){  
this.getlistHeight(1)  
}  
,methods:{  
          getlistHeight(list) {  
                let _this = this  
                let info = uni.createSelectorQuery().select(list);  
                info.boundingClientRect(function(data) {  
                    console.log(list);  
                    if(data){  
                        _this.height = data.height;  
                    }else{  
                        _this.getlistHeight(list)  
                    }  
                }).exec();  
    },  
}
2020-07-18 16:21 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

由于 uni-app刷新页面无法返回问题,做了一个适配

BackPage() {  
                const pages = getCurrentPages()  
                if (pages.length > 1) {  
                    uni.navigateBack({  
                        delta: 1  
                    });  
                    return  
                }  
                let a = this.$router.go(-1)  
                if (a == undefined) {  
                    uni.reLaunch({  
                        url: '/pages/index/index'  
                    })  
                }  

            },

该问题目前已经被锁定, 无法添加新回复