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

直接用v-tap时,会报错,并且会把移动端下所有的默认click覆盖掉 #50

Open
sujinw opened this issue Jul 5, 2017 · 10 comments

Comments

@sujinw
Copy link

sujinw commented Jul 5, 2017

image

@sujinw
Copy link
Author

sujinw commented Jul 5, 2017

比如input file

@MeCKodo
Copy link
Owner

MeCKodo commented Jul 5, 2017

可以给我看下你的html代码和js代码吗

@ghost
Copy link

ghost commented Jul 7, 2017

同样的报错

@MeCKodo
Copy link
Owner

MeCKodo commented Jul 7, 2017

各位大佬?可以给下你们的html和js代码吗?只说报错我怎么知道什么情况怎么复现呢?

@wxfjq313
Copy link
Contributor

wxfjq313 commented Aug 3, 2017

<router-link></router-lisnk> 上添加 v-tap 时 ,v-tap lib version = 3.0.2

tim 20170803154338

此时 value 可能为 undefined

@Cyrilszq
Copy link

Cyrilszq commented Aug 9, 2017

源码中在touchend事件中调用 e.preventDefault();导致click事件无效。可能是为了解决移动端点透问题。

el.addEventListener('touchend', function (e) {
          try {
            Object.defineProperty(e, 'currentTarget', {// 重写currentTarget对象 与jq相同
              value: el,
              writable: true,
              enumerable: true,
              configurable: true
            })
          } catch (e) {
            // ios 7下对 e.currentTarget 用defineProperty会报错。
            // 报“TypeError:Attempting to configurable attribute of unconfigurable property”错误
            // 在catch里重写
            console.error(e.message)
            e.currentTarget = el
          }
          e.preventDefault();

          return touchend(e, el);
        }, false);
      }

@Elsie23
Copy link

Elsie23 commented Aug 29, 2017

我也碰到这问题了,请问下最后是怎么解决的?

@wxfjq313
Copy link
Contributor

自己copy 下代码,然后把判断value条件放在value.event = e; 赋值之前~

@Elsie23
Copy link

Elsie23 commented Aug 29, 2017

谢谢 解决了!

@MeCKodo
Copy link
Owner

MeCKodo commented Aug 29, 2017

@wxfjq313 @Elsie23 可以提个PR哦。十分感谢

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

5 participants