@falcondev-oss/nuxt-layers-base 0.35.8 → 0.35.9

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.
@@ -11,6 +11,7 @@ export function useRouteParamString(
11
11
  export function useRouteParamString(paramName: string, options?: { optional?: boolean }) {
12
12
  const optional = options?.optional ?? false
13
13
 
14
+ const route = useRoute()
14
15
  const param = useRouteParams<string | undefined>(paramName)
15
16
 
16
17
  const paramRef = ref(param.value)
@@ -34,6 +35,13 @@ export function useRouteParamString(paramName: string, options?: { optional?: bo
34
35
  return computed({
35
36
  get: () => paramRef.value,
36
37
  set: (value) => {
38
+ if (param.value === undefined && value !== undefined) {
39
+ void navigateTo({
40
+ name: `${String(route.name)}-${paramName}`,
41
+ params: { ...route.params, [paramName]: value },
42
+ })
43
+ return
44
+ }
37
45
  param.value = value
38
46
  },
39
47
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@falcondev-oss/nuxt-layers-base",
3
3
  "type": "module",
4
- "version": "0.35.8",
4
+ "version": "0.35.9",
5
5
  "description": "Nuxt layer with lots of useful helpers and @nuxt/ui components",
6
6
  "license": "MIT",
7
7
  "repository": {