Skip to content

Instantly share code, notes, and snippets.

@lao9s
Created August 3, 2022 14:57
Show Gist options
  • Save lao9s/0d2bb8969b1deb70c6b92a9cfeaa1902 to your computer and use it in GitHub Desktop.
Save lao9s/0d2bb8969b1deb70c6b92a9cfeaa1902 to your computer and use it in GitHub Desktop.
import {usePage} from "@inertiajs/inertia-vue3";
watch(() => usePage().props.value.flash, flash => {
if (flash.success) {
open('success', flash.success);
}
if (flash.warning) {
open('warning', flash.warning);
}
if (flash.error) {
open('error', flash.error);
}
if (flash.info) {
open('info', flash.info);
}
}, {deep: true})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment