17 |
18 |
Using with Composition
19 |
20 |
21 |
22 |
23 |
24 | Using with Context Plugin
25 |
26 | node?.context?.inertia.post('/users', fields, { onSuccess: toastOnSuccess })
27 | ">
28 |
29 |
30 |
31 |
32 | Using with Global Context Plugin
33 |
34 | node?.context?.inertia.post('/users', fields, { onSuccess: toastOnSuccess, preserveScroll: true })
35 | ">
36 |
37 |
38 |
39 |
40 |
41 |
42 |
49 |
--------------------------------------------------------------------------------
/server/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import '../css/app.css'
2 | import 'vue-toastification/dist/index.css'
3 | import '@formkit/themes/genesis'
4 |
5 | import { createApp, h } from 'vue'
6 | import { createInertiaApp } from '@inertiajs/vue3'
7 | import { plugin as formkitPlugin, defaultConfig } from '@formkit/vue'
8 | import { plugin as inertiaPlugin } from 'formkit-addon-inertia'
9 | import Toast from 'vue-toastification'
10 |
11 | createInertiaApp({
12 | resolve: (name) => require(`./Pages/${name}`),
13 | setup({ el, App, props, plugin }) {
14 | createApp({ render: () => h(App, props) })
15 | .use(plugin)
16 | .use(
17 | formkitPlugin,
18 | defaultConfig({
19 | plugins: [inertiaPlugin],
20 | })
21 | )
22 | .use(Toast)
23 | .mount(el)
24 | },
25 | })
26 |
--------------------------------------------------------------------------------
/server/resources/js/vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import type { DefineComponent } from 'vue'
3 | const component: DefineComponent<{}, {}, any>
4 | export default component
5 | }
6 |
--------------------------------------------------------------------------------
/server/resources/views/app.edge:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |