diff --git a/components/dropdown/getDropdownProps.ts b/components/dropdown/getDropdownProps.ts index 8495d308d..8b0442284 100644 --- a/components/dropdown/getDropdownProps.ts +++ b/components/dropdown/getDropdownProps.ts @@ -3,8 +3,10 @@ import { PropType } from 'vue'; import PropTypes from '../_util/vue-types'; export default () => ({ trigger: { - type: Array as PropType<('click' | 'hover' | 'contextmenu')[]>, - default: () => ['hover'], + type: [Array, String] as PropType< + ('click' | 'hover' | 'contextmenu')[] | 'click' | 'hover' | 'contextmenu' + >, + default: 'hover', }, overlay: PropTypes.any, visible: PropTypes.looseBool, diff --git a/components/vc-dropdown/src/Dropdown.jsx b/components/vc-dropdown/src/Dropdown.jsx index 79faa73a9..318b67032 100644 --- a/components/vc-dropdown/src/Dropdown.jsx +++ b/components/vc-dropdown/src/Dropdown.jsx @@ -25,7 +25,9 @@ export default defineComponent({ overlayStyle: PropTypes.object.def(() => ({})), placement: PropTypes.string.def('bottomLeft'), overlay: PropTypes.any, - trigger: PropTypes.array.def(['hover']), + trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def( + 'hover', + ), alignPoint: PropTypes.looseBool, showAction: PropTypes.array.def([]), hideAction: PropTypes.array.def([]),