html52.com
我爱小程序-开发者交流社区

跳转报错​navigateBackwithanunexistwebviewId

问题模块
API和组件

返回时经常会出现  :“跳转报错  navigateBack with an unexist webviewId  151”


如果在某个页面中的onShow方法判断是否有权限访问,没有权限访问则跳转到另外一个页面,这种连续跳转会导致ios下报navigateBack with an unexist webviewId 这个错误


网友回复

文刀宀玉兴:

/**

* 防止出现这种错误

* navigateTo with an already exist webviewId

* navigateBack with an unexist webviewId

*/

var buttonClicked = function(that){

    that.setData({

        buttonClicked:false

    })

    setTimeout(function(){

        that.setData({

            buttonClicked: true

        })

    },500);

}


Page({


/**

  * 页面的初始数据

  */

    data: {

        buttonClicked: true

    },

    clickBtn:function(){

        if (!this.data.buttonClicked) { return }

         buttonClicked(this);

            //TODO....

    },

})

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付