From 0bb79c27a6b2a73c38ba36e93cd4ab47c7bd1010 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 10 Dec 2018 21:44:14 +0800 Subject: [PATCH] feat: update popconfirm and tooltip --- components/_util/props-util.js | 2 +- .../__snapshots__/index.test.js.snap | 3 +- components/popconfirm/__tests__/index.test.js | 8 +++- components/popconfirm/index.jsx | 46 ++++++++++++++----- components/tooltip/Tooltip.jsx | 14 +----- components/tooltip/__tests__/tooltip.test.js | 15 ------ components/tooltip/abstractTooltipProps.js | 1 + components/tooltip/placements.js | 1 + 8 files changed, 46 insertions(+), 44 deletions(-) diff --git a/components/_util/props-util.js b/components/_util/props-util.js index 6dba0f19f..9da6e289f 100644 --- a/components/_util/props-util.js +++ b/components/_util/props-util.js @@ -234,7 +234,7 @@ const initDefaultProps = (propTypes, defaultProps) => { export function mergeProps () { const args = [].slice.call(arguments, 0) const props = {} - args.forEach((p, i) => { + args.forEach((p = {}, i) => { for (const [k, v] of Object.entries(p)) { props[k] = props[k] || {} if (isPlainObject(v)) { diff --git a/components/popconfirm/__tests__/__snapshots__/index.test.js.snap b/components/popconfirm/__tests__/__snapshots__/index.test.js.snap index 7462f8f05..6bdb64797 100644 --- a/components/popconfirm/__tests__/__snapshots__/index.test.js.snap +++ b/components/popconfirm/__tests__/__snapshots__/index.test.js.snap @@ -6,8 +6,7 @@ exports[`Popconfirm should show overlay when trigger is clicked 1`] = `