提交 89e0e24a 编写于 作者: 雪洛's avatar 雪洛

update: 修复小程序端不能直接在模版内使用$emit的Bug askID:82865

上级 f2c85d4e
......@@ -1076,6 +1076,18 @@ function handleEvent (event) {
handlerCtx = handlerCtx.$parent.$parent;
}
const handler = handlerCtx[methodName];
if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx,
processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
));
return
}
if (!isFn(handler)) {
throw new Error(` _vm.${methodName} is not a function`)
}
......
......@@ -487,6 +487,18 @@ export function handleEvent (event) {
handlerCtx = handlerCtx.$parent.$parent
}
const handler = handlerCtx[methodName]
if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx,
processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
))
return
}
if (!isFn(handler)) {
throw new Error(` _vm.${methodName} is not a function`)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册