2024-01-29 16:44:54 +00:00
|
|
|
{
|
2024-01-31 09:54:01 +00:00
|
|
|
"pushed route, skips generation from file": [
|
|
|
|
{
|
|
|
|
"alias": "["pushed-route-alias"].concat(mockMeta?.alias || [])",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/route-file.vue")",
|
2024-01-31 09:54:01 +00:00
|
|
|
"meta": "{ ...(mockMeta || {}), ...{"someMetaData":true} }",
|
|
|
|
"name": "mockMeta?.name ?? "pushed-route"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-01-29 16:44:54 +00:00
|
|
|
"route without file": [
|
|
|
|
{
|
|
|
|
"alias": "["sweet-home"]",
|
|
|
|
"meta": "{"hello":"world"}",
|
|
|
|
"name": ""home"",
|
|
|
|
"path": ""/"",
|
|
|
|
},
|
|
|
|
],
|
2024-07-18 14:55:39 +00:00
|
|
|
"route.meta generated from file": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/page-with-meta.vue")",
|
2024-07-18 14:55:39 +00:00
|
|
|
"meta": "{ ...(mockMeta || {}), ...{"test":1} }",
|
|
|
|
"name": "mockMeta?.name ?? "page-with-meta"",
|
|
|
|
"path": "mockMeta?.path ?? "/page-with-meta"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-01-29 16:44:54 +00:00
|
|
|
"should allow pages with `:` in their path": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/test:name.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "test:name"",
|
|
|
|
"path": "mockMeta?.path ?? "/test\\:name"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should correctly merge nested routes": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/param/index/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "param-index"",
|
|
|
|
"path": "mockMeta?.path ?? """,
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("layer/pages/param/index/sibling.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "param-index-sibling"",
|
|
|
|
"path": "mockMeta?.path ?? "sibling"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("layer/pages/param/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? undefined",
|
|
|
|
"path": "mockMeta?.path ?? """,
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/param/sibling.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "param-sibling"",
|
|
|
|
"path": "mockMeta?.path ?? "sibling"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/param.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? undefined",
|
|
|
|
"path": "mockMeta?.path ?? "/param"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("layer/pages/wrapper-expose/other/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "wrapper-expose-other"",
|
|
|
|
"path": "mockMeta?.path ?? """,
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/wrapper-expose/other/sibling.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "wrapper-expose-other-sibling"",
|
|
|
|
"path": "mockMeta?.path ?? "sibling"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/wrapper-expose/other.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? undefined",
|
|
|
|
"path": "mockMeta?.path ?? "/wrapper-expose/other"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should extract serializable values and override fallback when normalized with `overrideMeta: true`": [
|
|
|
|
{
|
|
|
|
"alias": "["sweet-home"].concat(mockMeta?.alias || [])",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "home"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": ""/"",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct catch-all route": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[...slug].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "slug"",
|
|
|
|
"path": "mockMeta?.path ?? "/:slug(.*)*"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct dynamic routes": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[slug].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "slug"",
|
|
|
|
"path": "mockMeta?.path ?? "/:slug()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[foo]]/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "foo"",
|
|
|
|
"path": "mockMeta?.path ?? """,
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[foo]]")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? undefined",
|
|
|
|
"path": "mockMeta?.path ?? "/:foo?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/optional/[[opt]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "optional-opt"",
|
|
|
|
"path": "mockMeta?.path ?? "/optional/:opt?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/optional/prefix-[[opt]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "optional-prefix-opt"",
|
|
|
|
"path": "mockMeta?.path ?? "/optional/prefix-:opt?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/optional/[[opt]]-postfix.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "optional-opt-postfix"",
|
|
|
|
"path": "mockMeta?.path ?? "/optional/:opt?-postfix"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/optional/prefix-[[opt]]-postfix.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "optional-prefix-opt-postfix"",
|
|
|
|
"path": "mockMeta?.path ?? "/optional/prefix-:opt?-postfix"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[bar]/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "bar"",
|
|
|
|
"path": "mockMeta?.path ?? "/:bar()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/nonopt/[slug].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "nonopt-slug"",
|
|
|
|
"path": "mockMeta?.path ?? "/nonopt/:slug()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/opt/[[slug]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "opt-slug"",
|
|
|
|
"path": "mockMeta?.path ?? "/opt/:slug?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[sub]]/route-[slug].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "sub-route-slug"",
|
|
|
|
"path": "mockMeta?.path ?? "/:sub?/route-:slug()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct id for catchall (order 1)": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[...stories].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "stories"",
|
|
|
|
"path": "mockMeta?.path ?? "/:stories(.*)*"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/stories/[id].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "stories-id"",
|
|
|
|
"path": "mockMeta?.path ?? "/stories/:id()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct id for catchall (order 2)": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/stories/[id].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "stories-id"",
|
|
|
|
"path": "mockMeta?.path ?? "/stories/:id()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[...stories].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "stories"",
|
|
|
|
"path": "mockMeta?.path ?? "/:stories(.*)*"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct route for kebab-case file": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/kebab-case.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "kebab-case"",
|
|
|
|
"path": "mockMeta?.path ?? "/kebab-case"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct route for snake_case file": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/snake_case.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "snake_case"",
|
|
|
|
"path": "mockMeta?.path ?? "/snake_case"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct routes for index pages": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent"",
|
|
|
|
"path": "mockMeta?.path ?? "/parent"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent/child/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent-child"",
|
|
|
|
"path": "mockMeta?.path ?? "/parent/child"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should generate correct routes for parent/child": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent/child.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent-child"",
|
|
|
|
"path": "mockMeta?.path ?? "child"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent"",
|
|
|
|
"path": "mockMeta?.path ?? "/parent"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-08-12 21:16:04 +00:00
|
|
|
"should handle route groups": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/(foo)/index.vue")",
|
2024-08-12 21:16:04 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/(bar)/about/index.vue")",
|
2024-08-12 21:16:04 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "about"",
|
|
|
|
"path": "mockMeta?.path ?? """,
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/(foo)/about.vue")",
|
2024-08-12 21:16:04 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? undefined",
|
|
|
|
"path": "mockMeta?.path ?? "/about"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-01-29 16:44:54 +00:00
|
|
|
"should handle trailing slashes with index routes": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
|
|
|
"children": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index/index/all.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index-index-all"",
|
|
|
|
"path": "mockMeta?.path ?? "all"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-07-18 14:55:39 +00:00
|
|
|
"should merge route.meta with meta from file": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/page-with-meta.vue")",
|
2024-07-18 14:55:39 +00:00
|
|
|
"meta": "{ ...(mockMeta || {}), ...{"test":1} }",
|
|
|
|
"name": "mockMeta?.name ?? "page-with-meta"",
|
|
|
|
"path": "mockMeta?.path ?? "/page-with-meta"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
2024-01-29 16:44:54 +00:00
|
|
|
"should not generate colliding route names when hyphens are in file name": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent/[child].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent-child"",
|
|
|
|
"path": "mockMeta?.path ?? "/parent/:child()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/parent-[child].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "parent-child"",
|
|
|
|
"path": "mockMeta?.path ?? "/parent-:child()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should not merge required param as a child of optional param": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[foo]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "foo"",
|
|
|
|
"path": "mockMeta?.path ?? "/:foo?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[foo].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "foo"",
|
|
|
|
"path": "mockMeta?.path ?? "/:foo()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should only allow "_" & "." as special character for dynamic route": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[a1_1a].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "a1_1a"",
|
|
|
|
"path": "mockMeta?.path ?? "/:a1_1a()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[b2.2b].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "b2.2b"",
|
|
|
|
"path": "mockMeta?.path ?? "/:b2.2b()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[b2]_[2b].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "b2_2b"",
|
|
|
|
"path": "mockMeta?.path ?? "/:b2()_:2b()"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[c3@3c]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "c33c"",
|
|
|
|
"path": "mockMeta?.path ?? "/:c33c?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/[[d4-4d]].vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "d44d"",
|
|
|
|
"path": "mockMeta?.path ?? "/:d44d?"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should properly override route name if definePageMeta name override is defined.": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "home"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"should use fallbacks when normalized with `overrideMeta: true`": [
|
|
|
|
{
|
|
|
|
"alias": "mockMeta?.alias || []",
|
2024-09-10 13:56:08 +00:00
|
|
|
"component": "() => import("pages/index.vue")",
|
2024-01-29 16:44:54 +00:00
|
|
|
"meta": "mockMeta || {}",
|
|
|
|
"name": "mockMeta?.name ?? "index"",
|
|
|
|
"path": "mockMeta?.path ?? "/"",
|
|
|
|
"redirect": "mockMeta?.redirect",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|