Skip to content

Commit

Permalink
fix(okam-build): fix weixin template event transformation data-* style
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhy committed Nov 1, 2018
1 parent 85a8286 commit 824af2f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const {
NOT_SUPPORT_MODIFIERS
} = require('./constant');

const {toHyphen} = require('../../../../util').string;

// 1. 使用正则将函数名和函数参数拆分开
// 2. 给事件绑定事件代理函数__handlerProxy
// 3. 将原函数名handleClick保存在data-tap-event-proxy中
Expand All @@ -38,6 +40,8 @@ module.exports = function (attrs, name, tplOpts) {
// use __handlerProxy(in okam-core/base/component) to agent the event handler
attrs[eventAttrName] = '__handlerProxy';

eventType = toHyphen(eventType); // covert the camel case to dash-style

// save the real event handler
attrs[`data-${eventType}-event-proxy`] = handlerName;

Expand Down

0 comments on commit 824af2f

Please sign in to comment.