uniapp

uniapp中web-view引入页面返回问题

uniapp中的web-view组件引入页面后,返回失效问题

返回后发现报错:Uncaught ReferenceError: mui is not defined at

有些网页使用MUI框架开发的,所以需要将 mui 的返回关闭

解决:

onReady() {
  this.clearMuiBack();
},
methods: {
  // 关闭mui返回
  clearMuiBack() {
    // #ifdef APP-PLUS
    var currentWebview = this.$scope.$getAppWebview().children()[0];
    //监听注入的js
    currentWebview.addEventListener("loaded", function() {
      currentWebview.evalJS("mui.init({keyEventBind: {backbutton: false }});");
    });
    // #endif
  },
}

208条评论

  • Concepcion

    I am now not positive the place you are getting your information, however good topic. I needs to spend a while finding out more or understanding more. Thank you for magnificent information I used to be in search of this information for my mission.

  • DennisLar

    Plastic, Reconstructive, and Aesthetic Surgery treat congenital and acquired aesthetic, shape, and functional disorders. Specialist plastic surgeons meet the requirements of the branch. Cosmetic surgery in Turkey includes plastic, Reconstructive, and Aesthetic Surgical operations.
    if there’s anything else that you need you can write me.
    thanks in advance for your services

  • patient

    I like the helpful information you provide in your articles. I will bookmark your blog and check again here frequently. I am quite sure I will learn many new stuff right here! Best of luck for the next!

Leave a Reply

邮箱地址不会被公开。