fix: replenish popover missing types (#5958)

* fix: replenish popover missing types

* fix: update
This commit is contained in:
啝裳 2022-02-11 17:56:21 +08:00 committed by GitHub
parent fa54266588
commit dafc701af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 6 deletions

View File

@ -11,3 +11,5 @@ export const ElDropdown = withInstall(Dropdown, {
export default ElDropdown
export const ElDropdownItem = withNoopInstall(DropdownItem)
export const ElDropdownMenu = withNoopInstall(DropdownMenu)
export * from './src/dropdown'
export * from './src/tokens'

View File

@ -79,7 +79,7 @@ describe('Popover.vue', () => {
wrapper = makeMount(Popover, {
props: {
content,
appendToBody: false,
teleported: false,
virtualRef,
virtualTriggering: true,
},

View File

@ -2,6 +2,20 @@
<el-tooltip
ref="tooltipRef"
v-bind="$attrs"
:trigger="trigger"
:placement="placement"
:disabled="disabled"
:visible="visible"
:transition="transition"
:popper-options="popperOptions"
:tabindex="tabindex"
:append-to-body="appendToBody"
:content="content"
:offset="offset"
:show-after="showAfter"
:hide-after="hideAfter"
:auto-close="autoClose"
:show-arrow="showArrow"
:aria-label="title"
:effect="effect"
:enterable="enterable"

View File

@ -1,11 +1,19 @@
import { buildProps } from '@element-plus/utils'
import { useTooltipContentProps } from '@element-plus/components/tooltip'
import {
useTooltipContentProps,
useTooltipTriggerProps,
} from '@element-plus/components/tooltip'
import { dropdownProps } from '@element-plus/components/dropdown'
export const usePopoverProps = buildProps({
appendToBody: {
type: Boolean,
default: undefined,
},
trigger: useTooltipTriggerProps.trigger,
placement: dropdownProps.placement,
disabled: useTooltipTriggerProps.disabled,
visible: useTooltipContentProps.visible,
transition: useTooltipContentProps.transition,
popperOptions: dropdownProps.popperOptions,
tabindex: dropdownProps.tabindex,
appendToBody: { type: Boolean, default: undefined },
content: useTooltipContentProps.content,
popperStyle: useTooltipContentProps.popperStyle,
popperClass: useTooltipContentProps.popperClass,
@ -24,4 +32,24 @@ export const usePopoverProps = buildProps({
type: [String, Number],
default: 150,
},
offset: {
type: Number,
default: 0,
},
showAfter: {
type: Number,
default: 0,
},
hideAfter: {
type: Number,
default: 200,
},
autoClose: {
type: Number,
default: 0,
},
showArrow: {
type: Boolean,
default: true,
},
} as const)