From 8d183a3f17d7870fea3b677d3de6f6f700c2b9e2 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 8 Apr 2019 20:41:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(runtime):=20=E5=8E=9F=E7=94=9F=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6=E4=BA=8B=E4=BB=B6=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-app-plus/dist/index.js | 13 ++++++++----- packages/uni-app-plus/package.json | 2 +- packages/uni-mp-weixin/dist/index.js | 13 ++++++++----- packages/uni-mp-weixin/package.json | 2 +- src/core/runtime/wrapper/util.js | 13 ++++++++----- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 0ac066a84..82621c603 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -489,14 +489,17 @@ function processEventExtra (vm, extra) { } function processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) { - if (isCustom && !args.length) { // 无参数,直接传入 detail 数组 - if (event.currentTarget && + if (isCustom) { // 自定义事件 + if ( + event.currentTarget && event.currentTarget.dataset && - event.currentTarget.dataset.comType === 'wx') { - // 使用了 wxcomponent 原生组件,传递原始 event 对象 + event.currentTarget.dataset.comType === 'wx' + ) { // wxcomponent 原生组件,传递原始 event 对象 return [event] } - return event.detail + if (!args.length) { // 无参数,直接传入 detail 数组 + return event.detail + } } const extraObj = processEventExtra(vm, extra); diff --git a/packages/uni-app-plus/package.json b/packages/uni-app-plus/package.json index c448bf447..7cfe670af 100644 --- a/packages/uni-app-plus/package.json +++ b/packages/uni-app-plus/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-app-plus", - "version": "0.0.210", + "version": "0.0.211", "description": "uni-app app-plus", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index a9078a7e2..da9b3d5cc 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -516,14 +516,17 @@ function processEventExtra (vm, extra) { } function processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) { - if (isCustom && !args.length) { // 无参数,直接传入 detail 数组 - if (event.currentTarget && + if (isCustom) { // 自定义事件 + if ( + event.currentTarget && event.currentTarget.dataset && - event.currentTarget.dataset.comType === 'wx') { - // 使用了 wxcomponent 原生组件,传递原始 event 对象 + event.currentTarget.dataset.comType === 'wx' + ) { // wxcomponent 原生组件,传递原始 event 对象 return [event] } - return event.detail + if (!args.length) { // 无参数,直接传入 detail 数组 + return event.detail + } } const extraObj = processEventExtra(vm, extra); diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json index 6b288fe52..f4c196fe4 100644 --- a/packages/uni-mp-weixin/package.json +++ b/packages/uni-mp-weixin/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-weixin", - "version": "0.0.929", + "version": "0.0.930", "description": "uni-app mp-weixin", "main": "dist/index.js", "scripts": { diff --git a/src/core/runtime/wrapper/util.js b/src/core/runtime/wrapper/util.js index 19f1509f8..c966919e4 100644 --- a/src/core/runtime/wrapper/util.js +++ b/src/core/runtime/wrapper/util.js @@ -197,14 +197,17 @@ function processEventExtra (vm, extra) { } function processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) { - if (isCustom && !args.length) { // 无参数,直接传入 detail 数组 - if (event.currentTarget && + if (isCustom) { // 自定义事件 + if ( + event.currentTarget && event.currentTarget.dataset && - event.currentTarget.dataset.comType === 'wx') { - // 使用了 wxcomponent 原生组件,传递原始 event 对象 + event.currentTarget.dataset.comType === 'wx' + ) { // wxcomponent 原生组件,传递原始 event 对象 return [event] } - return event.detail + if (!args.length) { // 无参数,直接传入 detail 数组 + return event.detail + } } const extraObj = processEventExtra(vm, extra) -- GitLab