vue单页面在iOS微信浏览器中弹出底部栏导致的样式问题

只需要在app.vue的mounted里面添加如下代码即可解决这个问题 mounted() {const u = navigator.userAgentconst isiOS = !!u.match((i[^;]+;( U;)? CPU

只需要在app.vue的mounted里面添加如下代码即可解决这个问题

 mounted() {
   
    const u = navigator.userAgent
    const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
    if (isiOS) {
   
      window.history.pushState({
   }, 'title', '#')
    }
  },

这里顺便说一下在ios页面下出现了无法滚动的Bug,可以尝试使用以下方式解决,
例如,这个warpper是产生滚动条的地方

<template>
  <div class="home footer-bar">
    <!-- 头部搜索 -->
    <search />
    <div class="wrapper"><

发布者:admin,转转请注明出处:http://www.yc00.com/web/1735051380a3783855.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信