inertiax-svelte 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Frame.svelte +5 -3
- package/src/useForm.js +1 -0
package/package.json
CHANGED
package/src/Frame.svelte
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
import Render, { h } from './Render.svelte'
|
|
4
4
|
import store from './store'
|
|
5
5
|
import { router } from 'inertiax-svelte'
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
const {children, src, hint, component, id = Math.random(), ...restProps} = $props()
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
setContext('inertia:frame-id', id)
|
|
10
10
|
|
|
11
11
|
const components = $derived($store.frames?.[id] && h($store.frames[id].component.default, Object.assign({}, restProps, $store.frames[id].props)))
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
onMount(() => {
|
|
14
|
+
// we already have components (probably from history navigation), don't need to make a request
|
|
15
|
+
if (components) return;
|
|
14
16
|
router.visit(src, {
|
|
15
17
|
target: id,
|
|
16
18
|
hint,
|
package/src/useForm.js
CHANGED