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

支持capture事件 #839

Merged
merged 4 commits into from
Jan 31, 2018
Merged

支持capture事件 #839

merged 4 commits into from
Jan 31, 2018

Conversation

milkmeowo
Copy link
Contributor

@milkmeowo milkmeowo commented Jan 25, 2018

Checklist
  • npm run test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • cases or donate is changed or added
  • documentation is changed or added

fix #542
支持 @tap.capture@tap.capture.stop 的语法

@coveralls
Copy link

coveralls commented Jan 25, 2018

Coverage Status

Coverage decreased (-84.8%) to 1.318% when pulling ac7208e on milkmeowo:fix/542 into d5c71c1 on Tencent:master.

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 30, 2018

建议补充一下文档

@milkmeowo
Copy link
Contributor Author

@Gcaufy 已经补充文档和测试用例

@Gcaufy Gcaufy merged commit 3520632 into Tencent:master Jan 31, 2018
@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 31, 2018

cool, thanks.

@milkmeowo
Copy link
Contributor Author

@Gcaufy travis ci 还是报错? what happen?

@rchunping
Copy link

@milkmeowo 感谢
在page中使用 @touchstart.capture="handler" 没问题

但在组件中使用 @touchstart.capture="handler" 有点问题,没有转换handler到组件自己的方法
编译出来还是 capture-bind:touchstart="handler" 而正确结果应该是类似 capture-bind:touchstart="$comName$handler" 这样的。(其他非.capture的编译时都能正确转换)

急着用,翻了半天源码还没找到,不知道在哪个文件中处理这部分的?

@rchunping
Copy link

ok,找到了,我去递交patch

Index: packages/wepy-cli/src/compile-template.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- packages/wepy-cli/src/compile-template.js	(revision b8d11089f74e7cefc3eaf33e5d2e0de3456197c1)
+++ packages/wepy-cli/src/compile-template.js	(date 1520155583928)
@@ -283,7 +283,7 @@
                 }
                 // bindtap="abc" => bindtap="prefix_abc"
                 if (
-                    (config.output !== 'ant' && (attr.name.indexOf('bind') === 0 || attr.name.indexOf('catch') === 0)) ||
+                    (config.output !== 'ant' && (attr.name.indexOf('bind') === 0 || attr.name.indexOf('catch') === 0 || attr.name.indexOf('capture') === 0)) ||
                     (config.output === 'ant' && (attr.name.indexOf('on') === 0 || attr.name.indexOf('catch') === 0))
                     ) {
                     // added index for all events;

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

Successfully merging this pull request may close these issues.

4 participants