Skip to content

Commit

Permalink
docs: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Dec 3, 2024
1 parent 5ca38fb commit 8583353
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/varlet-ui/src/menu/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ const placementOptions = ref([
'cover-right',
])
watchLang(use)
onThemeChange()
function closeMenu() {
show.value = false
}
watchLang(use)
onThemeChange()
</script>

<template>
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/tooltip/props.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineListenerProp } from '../utils/components'
import { type PropType, type TeleportProps } from 'vue'
import type { NeededPopperPlacement, Trigger } from '../menu/usePopover'
import type { NeededPopperPlacement, Reference, Trigger } from '../menu/usePopover'
import type { PositioningStrategy } from '@popperjs/core'

export type Placement = NeededPopperPlacement
Expand All @@ -21,7 +21,7 @@ export const props = {
type: String as PropType<Trigger>,
default: 'hover',
},
reference: String,
reference: [String, Object] as PropType<Reference>,
placement: {
type: String as PropType<Placement>,
default: 'bottom',
Expand Down
4 changes: 3 additions & 1 deletion packages/varlet-ui/types/menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export type MenuTrigger = 'click' | 'hover' | 'manual'

export type MenuStrategy = PositioningStrategy

export type MenuReference = string | HTMLElement

export interface MenuProps extends BasicAttributes {
show?: boolean
disabled?: boolean
trigger?: MenuTrigger
reference?: string
reference?: MenuReference
placement?: MenuPlacement
strategy?: MenuStrategy
offsetX?: string | number
Expand Down
4 changes: 3 additions & 1 deletion packages/varlet-ui/types/menuSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type MenuSelectStrategy = PositioningStrategy

export type MenuSelectSize = 'normal' | 'mini' | 'small' | 'large'

export type MenuSelectReference = string | HTMLElement

export type MenuSelectOptionLabelRender = (option: MenuSelectOption, checked: boolean) => VNodeChild

export interface MenuSelectOption {
Expand All @@ -42,7 +44,7 @@ export interface MenuSelectProps extends BasicAttributes {
show?: boolean
disabled?: boolean
trigger?: MenuSelectTrigger
reference?: string
reference?: MenuSelectReference
placement?: MenuSelectPlacement
strategy?: MenuSelectStrategy
offsetX?: string | number
Expand Down
4 changes: 3 additions & 1 deletion packages/varlet-ui/types/tooltip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export type TooltipPlacement = TooltipNeededPopperPlacement

export type TooltipTrigger = 'click' | 'hover' | 'manual'

export type TooltipReference = string | HTMLElement

export type TooltipType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger'

export type TooltipStrategy = PositioningStrategy
Expand All @@ -23,7 +25,7 @@ export interface TooltipProps extends BasicAttributes {
textColor?: string
type?: TooltipType
trigger?: TooltipTrigger
reference?: string
reference?: TooltipReference
placement?: TooltipPlacement
strategy?: TooltipStrategy
offsetX?: string | number
Expand Down

0 comments on commit 8583353

Please sign in to comment.