adding prompt before logout

This commit is contained in:
Geriano
2022-07-30 11:53:11 +07:00
parent 1cbeee254a
commit ad8bed0576

View File

@@ -3,11 +3,21 @@ import { getCurrentInstance, ref } from 'vue'
import { usePage, Link } from '@inertiajs/inertia-vue3'
import { Inertia } from '@inertiajs/inertia'
import Icon from '../Icon.vue'
import Swal from 'sweetalert2'
const open = ref(false)
const { user } = usePage().props.value
const logout = () => Inertia.post(route('logout'))
const logout = async () => {
const response = await Swal.fire({
title: 'Are you sure?',
icon: 'question',
showCloseButton: true,
showCancelButton: true,
})
response.isConfirmed && Inertia.post(route('logout'))
}
</script>
<style scoped>