提交 d4437d35 编写于 作者: D DCloud_LXH

fix: 修复 字节小程序$emit不触发 fixed #2774

上级 7022f610
...@@ -1088,13 +1088,13 @@ function initTriggerEvent (mpInstance) { ...@@ -1088,13 +1088,13 @@ function initTriggerEvent (mpInstance) {
} }
function initHook (name, options) { function initHook (name, options) {
const oldHook = options[name]; const oldHook = options.lifetimes[name];
if (!oldHook) { if (!oldHook) {
options[name] = function () { options.lifetimes[name] = function () {
initTriggerEvent(this); initTriggerEvent(this);
}; };
} else { } else {
options[name] = function (...args) { options.lifetimes[name] = function (...args) {
initTriggerEvent(this); initTriggerEvent(this);
return oldHook.apply(this, args) return oldHook.apply(this, args)
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册