mirror of
https://github.com/unraid/api.git
synced 2026-01-04 07:29:48 -06:00
24 lines
649 B
TypeScript
24 lines
649 B
TypeScript
import { useToggle } from '@vueuse/core';
|
|
import { defineStore, createPinia, setActivePinia } from 'pinia';
|
|
|
|
/**
|
|
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
|
|
* @see https://github.com/vuejs/pinia/discussions/1085
|
|
*/
|
|
setActivePinia(createPinia());
|
|
|
|
export const useModalStore = defineStore('modal', () => {
|
|
const modalVisible = ref<boolean>(true);
|
|
|
|
const modalHide = () => { modalVisible.value = false; };
|
|
const modalShow = () => { modalVisible.value = true; };
|
|
const modalToggle = useToggle(modalVisible);
|
|
|
|
return {
|
|
modalVisible,
|
|
modalHide,
|
|
modalShow,
|
|
modalToggle,
|
|
};
|
|
});
|