From 1f5469c6ae965eb1edbd431783afcc7562712960 Mon Sep 17 00:00:00 2001 From: airyland Date: Wed, 2 Aug 2017 10:08:04 +0800 Subject: [PATCH] actionsheet: Fix json parsing issue for cancel menu (Fix #1782) --- src/components/actionsheet/index.vue | 6 +++++- src/components/actionsheet/metas.yml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/actionsheet/index.vue b/src/components/actionsheet/index.vue index eb35d9327..00c7e5393 100755 --- a/src/components/actionsheet/index.vue +++ b/src/components/actionsheet/index.vue @@ -92,7 +92,11 @@ export default { }, emitEvent (event, menu, item) { if (event === 'on-click-menu' && !/.noop/.test(menu)) { - this.$emit(event, menu, typeof item === 'string' ? item : JSON.parse(JSON.stringify(item))) + let _item = item + if (typeof _item === 'object') { + _item = JSON.parse(JSON.stringify(_item)) + } + this.$emit(event, menu, _item) this.$emit(`${event}-${menu}`) this.closeOnClickingMenu && (this.show = false) } diff --git a/src/components/actionsheet/metas.yml b/src/components/actionsheet/metas.yml index 829f5f293..33c5a1c3f 100755 --- a/src/components/actionsheet/metas.yml +++ b/src/components/actionsheet/metas.yml @@ -141,6 +141,11 @@ events: en: triggers when clicking on mask zh-CN: 点击遮罩时触发 changes: + next: + en: + - '[fix] Fix json parsing issue for cancel menu #1782' + zh-CN: + - '[fix] 修复取消菜单上的 json 解析错误 #1782' v2.5.5: en: - '[feature] Add raw menu item for on-click-menu event #1772'