提交 bd5d4c49 编写于 作者: fxy060608's avatar fxy060608

build uni-mp-weixin 0.0.926

上级 4c8bf949
...@@ -509,24 +509,26 @@ function handleEvent (event) { ...@@ -509,24 +509,26 @@ function handleEvent (event) {
if (eventsArray && eventType === type) { if (eventsArray && eventType === type) {
eventsArray.forEach(eventArray => { eventsArray.forEach(eventArray => {
const methodName = eventArray[0]; const methodName = eventArray[0];
const handler = this.$vm[methodName]; if (methodName) {
if (!isFn(handler)) { const handler = this.$vm[methodName];
throw new Error(` _vm.${methodName} is not a function`) if (!isFn(handler)) {
} throw new Error(` _vm.${methodName} is not a function`)
if (isOnce) { }
if (handler.once) { if (isOnce) {
return if (handler.once) {
return
}
handler.once = true;
} }
handler.once = true; handler.apply(this.$vm, processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
));
} }
handler.apply(this.$vm, processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
));
}); });
} }
}); });
......
{ {
"name": "@dcloudio/uni-mp-weixin", "name": "@dcloudio/uni-mp-weixin",
"version": "0.0.925", "version": "0.0.926",
"description": "uni-app mp-weixin", "description": "uni-app mp-weixin",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -252,24 +252,26 @@ export function handleEvent (event) { ...@@ -252,24 +252,26 @@ export function handleEvent (event) {
if (eventsArray && eventType === type) { if (eventsArray && eventType === type) {
eventsArray.forEach(eventArray => { eventsArray.forEach(eventArray => {
const methodName = eventArray[0] const methodName = eventArray[0]
const handler = this.$vm[methodName] if (methodName) {
if (!isFn(handler)) { const handler = this.$vm[methodName]
throw new Error(` _vm.${methodName} is not a function`) if (!isFn(handler)) {
} throw new Error(` _vm.${methodName} is not a function`)
if (isOnce) { }
if (handler.once) { if (isOnce) {
return if (handler.once) {
return
}
handler.once = true
} }
handler.once = true handler.apply(this.$vm, processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
))
} }
handler.apply(this.$vm, processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
))
}) })
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册