年度账单h5 移动端兼容问题以及优化建议(vue)

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

年度账单h5 移动端兼容问题以及优化建议(vue)

_skylar   2021-02-07 我要评论
    1. 定时器 

      vue实例中定义timer多余,创建的定时器代码和销毁定时器的代码没有放在一起,通常很容易忘记去清理这个定时器,不容易维护;建议使用this.$once(‘hook:beforeDestory’,()=>{});

          _CountDownLoop() {
            let timer = null;
            timer = setInterval(() => {
            // to do
            }, 1000);
            this.$once('hook:beforeDestroy', () => {
              clearInterval(timer);
              timer = null;
            });
          }, 
    2. 微信背景音乐不播放

      引入 <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>

         document.addEventListener('WeixinJSBridgeReady', () => {
      
            this.$refs.audio.play();
      
          }, false);
    3. ios 11 12音乐播放两次

      <audio ref="loading"  loop src="../../assets/audio/loading.mp3" atoplay  preload />

      标签中使用atoplay  导致
      解决

      <audio ref="loading"  loop src="../../assets/audio/loading.mp3" preload />
      mounted() {
        this.$refs.audio.play();
      }
       
    4. swiper兼容

      不兼容ios10以下版本,导致白屏问题;可降低到swiper4* ,如3.4.2,可以兼容到iOS8也可以选择不使用;
      swiper6 autoplay不生效,回退到5.x版本以下就可以正常使用了

    5. html2cancas

      html2canvas 1.0.0-rc. 7在H5微信内置浏览器ios13.6、13.4系统下不能转换图片;换成1.0.0-rc.4 "html2canvas": "1.0.0-rc.4", 

    6. ios移动端 boder-dotted 显示是方块

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们