](https://advanced-inertia.com)
12 |
13 | Take your Inertia.js skills to the next level with my book [Advanced Inertia](https://advanced-inertia.com/).
14 | Learn advanced concepts and make apps with Laravel and Inertia.js a breeze to build and maintain.
15 |
16 | ## Momentum
17 |
18 | Momentum is a set of packages designed to improve your experience building Inertia-powered apps.
19 |
20 | - [Modal](https://github.com/lepikhinb/momentum-modal) — Build dynamic modal dialogs for Inertia apps
21 | - [Preflight](https://github.com/lepikhinb/momentum-preflight) — Realtime backend-driven validation for Inertia apps
22 | - [Paginator](https://github.com/lepikhinb/momentum-paginator) — Headless wrapper around Laravel Pagination
23 | - [Trail](https://github.com/lepikhinb/momentum-trail) — Frontend package to use Laravel routes with Inertia
24 | - [Lock](https://github.com/lepikhinb/momentum-lock) — Frontend package to use Laravel permissions with Inertia
25 | - [Layout](https://github.com/lepikhinb/momentum-layout) — Persistent layouts for Vue 3 apps
26 | - [Vite Plugin Watch](https://github.com/lepikhinb/vite-plugin-watch) — Vite plugin to run shell commands on file changes
27 |
28 | ## Credits
29 |
30 | ## Credits
31 |
32 | - [Boris Lepikhin](https://twitter.com/lepikhinb)
33 | - [All Contributors](../../contributors)
34 |
35 | ## License
36 |
37 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
38 |
--------------------------------------------------------------------------------
/src/use-modal.ts:
--------------------------------------------------------------------------------
1 | import { usePage } from "@inertiajs/vue3"
2 | import { router } from "@inertiajs/vue3"
3 | import { defineAsyncComponent, h, nextTick, watch, computed, ref, shallowRef } from "vue"
4 | import axios from "axios"
5 | import resolver from "./resolver"
6 |
7 | const page = usePage()
8 | const modal = computed(() => page?.props?.modal)
9 | const props = computed(() => modal.value?.props)
10 | const key = computed(() => modal.value?.key)
11 |
12 | const componentName = ref()
13 | const component = shallowRef()
14 | const show = ref(false)
15 | const vnode = ref()
16 | const nonce = ref()
17 |
18 | const setHeaders = (values: Record