Move base-select into base

This commit is contained in:
Darko Gjorgjijoski
2025-08-28 12:02:39 +02:00
parent 70bfe1b688
commit 697c1af065
72 changed files with 77 additions and 77 deletions

View File

@@ -0,0 +1,35 @@
import { ref, toRefs } from 'vue'
export default function useDropdown(props, context, dep) {
const { disabled } = toRefs(props)
// ================ DATA ================
const isOpen = ref(false)
// =============== METHODS ==============
const open = () => {
if (isOpen.value || disabled.value) {
return
}
isOpen.value = true
context.emit('open')
}
const close = () => {
if (!isOpen.value) {
return
}
isOpen.value = false
context.emit('close')
}
return {
isOpen,
open,
close,
}
}