From 36d95b18fddbfeb0c0716fce12a7117b39c6886b Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 21 Mar 2020 17:29:53 +0800 Subject: [PATCH] fix: input-search custom button not work #1916 --- components/input/Search.jsx | 5 +++-- components/input/__tests__/__snapshots__/demo.test.js.snap | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/input/Search.jsx b/components/input/Search.jsx index 62b72fe1a..34d4ac6dd 100644 --- a/components/input/Search.jsx +++ b/components/input/Search.jsx @@ -5,8 +5,8 @@ import Icon from '../icon'; import inputProps from './inputProps'; import Button from '../button'; import { cloneElement } from '../_util/vnode'; -import { getOptionProps, getComponentFromProp, getListeners } from '../_util/props-util'; import PropTypes from '../_util/vue-types'; +import { getOptionProps, getComponentFromProp, getListeners } from '../_util/props-util'; import { ConfigConsumerProps } from '../config-provider'; export default { @@ -18,7 +18,8 @@ export default { }, props: { ...inputProps, - enterButton: PropTypes.any.def(false), + // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916 + enterButton: PropTypes.any, }, inject: { configProvider: { default: () => ConfigConsumerProps }, diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 6de4a46b2..958ab7a6f 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -56,7 +56,7 @@ exports[`renders ./antdv-demo/docs/input/demo/password-input.md correctly 1`] = exports[`renders ./antdv-demo/docs/input/demo/presuffix.md correctly 1`] = `