Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vux开发,异常处理日志(微信浏览器) #2918

Open
565784135 opened this issue Jul 11, 2018 · 0 comments
Open

vux开发,异常处理日志(微信浏览器) #2918

565784135 opened this issue Jul 11, 2018 · 0 comments

Comments

@565784135
Copy link

565784135 commented Jul 11, 2018

我就是菜鸟,记录一下我自己处理的一些异常情况。
持续更新。
8、微信权限配置 wx.config ,ios和android兼容问题
处理:iOS记录并使用第一次打开的链接。
注:授权链接要过滤vue-router的参数,不能使用router重定向。

7、微信电脑版内置浏览器是 Chrome/39.0, includes() 函数有兼容性问题
处理:使用indexOf。

6、webpack 模块化打包 webpackChunkName
低版本微信中,使用脏路由时有兼容性问题
处理:脏路由时不使用模块化

5、toast组件:this.$vux.toast, ios手机上某些情况下不显示 icon
处理:暂时不知道

4、x-input组件:Android低版下的微信浏览器兼容性问题 (小米2s,MIUI7.1)
处理:

//显示正常,但是msg获取不到值value
<x-input type="number" v-model="msg" /> 

//改成下面的写法
<x-input type="tel" v-model="msg" /> 

//或者
<x-input type="number" :value="msg" @input.native="msg = $event.target.value"/>
.........

3、使用 FastClick ,在 iOS 、chrome 中 触发点击事件不生效
处理:在触发元素上添加 class="needsclick"

// 图片上传
<p @click="$refs.input.click()">上传</p>
<input ref="input"  type="file" "/>

//改成下面的写法

<p class="needsclick" @click="$refs.input.click()">上传</p>
<input ref="input" accept="image/*"  type="file" "/>

// accept="image/*"  在移动端可以调起相机

2、使用npm install + webStorm 开发的时候项目老是崩,报错栈溢出 (win10,8G内存)
处理:使用yarn

1、popup组件,某些情况下,背景层滑动,
处理:提取组件源码,直接改

  watch: {
    value (val,old) {
      this.show = val
      if (val == true) {
        let cssStr = "overflow-y: hidden; height: 100%;";
        document.getElementsByTagName('html')[0].style.cssText = cssStr;
        document.body.style.cssText = cssStr;
      } else {
        document.getElementsByTagName('html')[0].removeAttribute('style');
        document.body.removeAttribute('style');
      }
      // 下面需要这两行代码,兼容不同浏览器
      document.body.scrollTop = this.pageScrollYoffset;
      window.scroll(0, this.pageScrollYoffset);
    },
.........

<style lang="less">
@import '../../node_modules/vux/src/styles/variable.less';
@import '../../node_modules/vux/src/styles/vux-modal.css';

......

//用的时候,直接引用
import Popup from '../../../../components/popup'

为什么这么处理,我也不知道,我只知道能解决问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant