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

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

上级 f2c85d4e
......@@ -1075,7 +1075,19 @@ function handleEvent (event) {
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
}
const handler = handlerCtx[methodName];
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`)
}
......
......@@ -486,7 +486,19 @@ export function handleEvent (event) {
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent
}
const handler = handlerCtx[methodName]
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.
先完成此消息的编辑!
想要评论请 注册