2022-01-04 09:15:15 +08:00
|
|
|
import { ref } from 'vue'
|
2022-04-19 12:46:57 +08:00
|
|
|
import { vi } from 'vitest'
|
2022-01-04 09:15:15 +08:00
|
|
|
|
|
|
|
export const genTooltipProvides = () => {
|
2022-04-19 12:46:57 +08:00
|
|
|
const onOpen = vi.fn()
|
|
|
|
const onClose = vi.fn()
|
|
|
|
const onToggle = vi.fn()
|
|
|
|
const onShow = vi.fn()
|
|
|
|
const onHide = vi.fn()
|
|
|
|
const onBeforeShow = vi.fn()
|
|
|
|
const onBeforeHide = vi.fn()
|
2022-01-04 09:15:15 +08:00
|
|
|
const id = ref('test_id')
|
|
|
|
const open = ref(false)
|
|
|
|
const controlled = ref(false)
|
|
|
|
const trigger = ref('hover')
|
|
|
|
|
|
|
|
return {
|
|
|
|
onToggle,
|
|
|
|
onOpen,
|
|
|
|
onClose,
|
|
|
|
onShow,
|
|
|
|
onHide,
|
2022-02-21 17:08:21 +08:00
|
|
|
onBeforeShow,
|
|
|
|
onBeforeHide,
|
2022-01-04 09:15:15 +08:00
|
|
|
id,
|
|
|
|
open,
|
|
|
|
controlled,
|
|
|
|
trigger,
|
|
|
|
}
|
|
|
|
}
|