15 lines
280 B
JavaScript
15 lines
280 B
JavaScript
|
import { ref } from 'vue';
|
||
|
|
||
|
export default function useAlert() {
|
||
|
const alertIsVisible = ref(false);
|
||
|
|
||
|
function showAlert() {
|
||
|
alertIsVisible.value = true;
|
||
|
}
|
||
|
function hideAlert() {
|
||
|
alertIsVisible.value = false;
|
||
|
}
|
||
|
|
||
|
return [alertIsVisible, showAlert, hideAlert];
|
||
|
}
|