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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
支持capture事件
  • Loading branch information
milkmeowo committed Jan 25, 2018
commit 56507303c06f27d5b4b4019b834387db1f4f7ca7
5 changes: 4 additions & 1 deletion packages/wepy-cli/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ const utils = {
type = '.once';
return ` v-bind:${name}${type}=`;
}).replace(/\s+\@([\w-_]*)([\.\w]*)\s*=/ig, (attr, name, type) => { // replace @change => v-on:change
let prefix = type !== '.user' ? (type === '.stop' ? 'catch' : 'bind') : 'v-on:';
let prefix = type !== '.user' ? (type.indexOf('.stop') === type.length - 5 ? 'catch' : 'bind') : 'v-on:';
if(type.indexOf('.capture') === 0){
prefix = `capture-${prefix}:`
}
if (config.output === 'ant' && prefix === 'bind') {
prefix = 'on';
name = name[0].toUpperCase() + name.substring(1);
Expand Down