mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 06:02:11 -03:00
- Add include/exclude folder modals for advanced filtering - Implement folder tree search with auto-expand functionality - Add hover tooltip to preview header showing matching LoRA thumbnails - Format match count with locale string for better readability - Prevent event propagation on refresh button click - Improve folder tree component with expand/collapse controls
32 lines
681 B
TypeScript
32 lines
681 B
TypeScript
import { ref, computed } from 'vue'
|
|
|
|
export type ModalType = 'baseModels' | 'includeTags' | 'excludeTags' | 'includeFolders' | 'excludeFolders' | null
|
|
|
|
export function useModalState() {
|
|
const activeModal = ref<ModalType>(null)
|
|
|
|
const isOpen = computed(() => activeModal.value !== null)
|
|
|
|
const openModal = (modal: ModalType) => {
|
|
activeModal.value = modal
|
|
}
|
|
|
|
const closeModal = () => {
|
|
activeModal.value = null
|
|
}
|
|
|
|
const isModalOpen = (modal: ModalType) => {
|
|
return activeModal.value === modal
|
|
}
|
|
|
|
return {
|
|
activeModal,
|
|
isOpen,
|
|
openModal,
|
|
closeModal,
|
|
isModalOpen
|
|
}
|
|
}
|
|
|
|
export type ModalStateReturn = ReturnType<typeof useModalState>
|