2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
@@ -0,0 +1,41 @@
import { ref } from 'vue'
import type { SetupContext } from 'vue'
import type { BubbleBoxEmits, BubbleBoxProps } from '../bubble-box'
import type { BubbleBoxOptionItemData } from '../types'
export const useBubbleBox = (
props: BubbleBoxProps,
emits: SetupContext<BubbleBoxEmits>['emit']
) => {
// 显示气泡弹出框
const showBubble = ref<boolean>(false)
const openBubbleOptions = () => {
emits('open')
showBubble.value = true
}
// 关闭气泡弹出框
const closeBubbleOptions = () => {
emits('close')
showBubble.value = false
}
// 气泡框选项点击事件
const bubbleOptionClickEvent = (
item: BubbleBoxOptionItemData,
index: number
) => {
if (props.disabled || item.disabled) return
emits('click', index)
if (props.autoClose) closeBubbleOptions()
}
return {
showBubble,
openBubbleOptions,
closeBubbleOptions,
bubbleOptionClickEvent,
}
}