feat(dropdown): allow pass string for prop trigger (#4199)

pull/4222/head
Carter Li 4 years ago committed by GitHub
parent 7624645d58
commit ce6f44f918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,

@ -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([]),

Loading…
Cancel
Save