GithubHelp home page GithubHelp logo

posva / unplugin-vue-router Goto Github PK

View Code? Open in Web Editor NEW
1.5K 12.0 68.0 4.15 MB

Next Generation file based typed routing for Vue Router

Home Page: https://uvr.esm.is

License: MIT License

JavaScript 3.29% HTML 0.13% TypeScript 88.85% Vue 7.74%
typescript vite vue vue-router

unplugin-vue-router's Introduction

unplugin-vue-router

NPM version ci status codecov

Automatic file based Routing in Vue with TS support ✨

This build-time plugin simplifies your routing setup and makes it safer and easier to use thanks to TypeScript. Requires Vue Router >=4.4.0.

Warning

While unplugin-vue-router typed routing and file based routing is fundamentally stable, it contains other experimental APIs that are subject to change (e.g. Data Loaders). Make sure to check the relevant Documentation for the latest information. If you find any issue, design flaw, or have ideas to improve it, please, open open an issue or a Discussion.

Install

npm i -D unplugin-vue-router

Add VueRouter plugin before Vue plugin:

Vite
// vite.config.ts
import VueRouter from 'unplugin-vue-router/vite'

export default defineConfig({
  plugins: [
    VueRouter({
      /* options */
    }),
    // ⚠️ Vue must be placed after VueRouter()
    Vue(),
  ],
})

Example: playground/


Rollup
// rollup.config.js
import VueRouter from 'unplugin-vue-router/rollup'

export default {
  plugins: [
    VueRouter({
      /* options */
    }),
    // ⚠️ Vue must be placed after VueRouter()
    Vue(),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-vue-router/webpack')({
      /* options */
    }),
  ],
}


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-vue-router/webpack')({
        /* options */
      }),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import VueRouter from 'unplugin-vue-router/esbuild'

build({
  plugins: [VueRouter()],
})


Setup

After installing, you should run your dev server (usually npm run dev) to generate the first version of the types. Then you need to add the types to your tsconfig.json.

{
  "include": [
    // ...
    "./typed-router.d.ts"
  ],
  // ...
  "compilerOptions": {
    // ...
    "moduleResolution": "Bundler"
    // ...
  }
}

Then, if you have an env.d.ts file like the one created by npm vue create <my-project>, add the unplugin-vue-router/client types to it:

// env.d.ts
/// <reference types="vite/client" />
/// <reference types="unplugin-vue-router/client" />

If you don't have an env.d.ts file, you can create one and add the unplugin-vue-router types to it or you can add them to the types property in your tsconfig.json:

{
  "compilerOptions": {
    // ...
    "types": ["unplugin-vue-router/client"]
  }
}

Finally, import the generated routes from vue-router/auto-routes and pass them to the router:

import { createRouter, createWebHistory } from 'vue-router'
+import { routes } from 'vue-router/auto-routes'

createRouter({
  history: createWebHistory(),
  // pass the generated routes written by the plugin 🤖
+  routes,
})

Alternatively, you can also import the routes array and create the router manually or pass it to some plugin. Here is an example with Vitesse starter:

 import { ViteSSG } from 'vite-ssg'
 import { setupLayouts } from 'virtual:generated-layouts'
 import App from './App.vue'
 import type { UserModule } from './types'
-import generatedRoutes from '~pages'
+import { routes } from 'vue-router/auto-routes'

 import '@unocss/reset/tailwind.css'
 import './styles/main.css'
 import 'uno.css'

-const routes = setupLayouts(generatedRoutes)

 // https://github.com/antfu/vite-ssg
 export const createApp = ViteSSG(
   App,
   {
-   routes,
+   routes: setupLayouts(routes),
    base: import.meta.env.BASE_URL
  },
   (ctx) => {
     // install all modules under `modules/`
     Object.values(import.meta.glob<{ install: UserModule }>('./modules/*.ts', { eager: true }))
       .forEach(i => i.install?.(ctx))
   },
 )

License

MIT

unplugin-vue-router's People

Contributors

antfu avatar charleewa avatar chuhoman avatar danielroe avatar edwardnyc avatar glows777 avatar hannoeru avatar hi-reeve avatar hooray avatar leemove avatar markthree avatar padcom avatar petardudas avatar pindapixel avatar posva avatar renovate[bot] avatar sardor01 avatar serkodev avatar sschneider-ihre-pvs avatar stefanprobst avatar sxzz avatar tamasfe avatar zhiyuanzmj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unplugin-vue-router's Issues

Nested route unloads parent

My problem is basically just the title, when I load a child component the parent is unloaded. This is a problem because I keep the navigation options on the parent. When I am using the plain router, it works just fine but using this plugin instead of nesting the page in the parent it just goes to the child and unloads the parent

bug: nested folders causes parent folder to use trailing slash

Problem

When defining routes that have both sub-routes, and an index of the parent route, unplugin-vue-router will generate the parent route types including a trailing slash. This causes inconsistencies throughout the routes -- this is also a different behavior compared to vite-plugin-pages.

Description

I have the following src/pages/ folder structure, which is used for all routing:

$ tree src/pages/
src/pages/
├── [...catchall].vue
├── dashboard
│   ├── guild
│   │   └── [id].vue
│   └── index.vue
├── index.vue
├── info
│   ├── privacy.vue
│   ├── service-health.vue
│   └── terms.vue
└── test.vue

3 directories, 8 files

Vite config:

    VueRouter({
      routesFolder: "src/pages",
      extensions: [".vue"],
      routeBlockLang: "yaml",
      logs: true,
    }),

And this is the auto-generated typed info from vite, that is most important to this issue:

declare module 'vue-router/auto/routes' {
  export interface RouteNamedMap {
    '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
    '/[...catchall]': RouteRecordInfo<'/[...catchall]', '/:catchall(.*)', { catchall: ParamValue<true> }, { catchall: ParamValue<false> }>,
    '/dashboard/': RouteRecordInfo<'/dashboard/', '/dashboard/', Record<never, never>, Record<never, never>>,
    '/dashboard/guild/[id]': RouteRecordInfo<'/dashboard/guild/[id]', '/dashboard/guild/:id', { id: ParamValue<true> }, { id: ParamValue<false> }>,
    '/info/privacy': RouteRecordInfo<'/info/privacy', '/info/privacy', Record<never, never>, Record<never, never>>,
    '/info/service-health': RouteRecordInfo<'/info/service-health', '/info/service-health', Record<never, never>, Record<never, never>>,
    '/info/terms': RouteRecordInfo<'/info/terms', '/info/terms', Record<never, never>, Record<never, never>>,
    '/test': RouteRecordInfo<'/test', '/test', Record<never, never>, Record<never, never>>,
  }
}

Looking at /dashboard/, because it has /dashboard/guild/[id] as a sub-path, this causes the dashboard/index.vue page to render as /dashboard/, where I believe it should be /dashboard. This is the behavior I have previously seen with vite-plugin-pages (see their readme that includes an example of a similar routing folder structure as above).

Technically, /dashboard is still routable, however any form of typed routing will always force that route to include the trailing slash, and this leads to inconsistent trailing slashes being used throughout the frontend.

Version Info

  • vue 3.2.39
  • vite 3.1.2
  • unplugin-vue-router 0.2.1

route blocks should be stripped in client code

so, i'm trying to migrate once more.
but now it raise a new problem. i have no idea where is this came from.

this the error on browser log
image

the new red error is showing the error in this source map, but there is nothing wrong with the custom route block on my file.
image

'"unplugin-vue-router"' has no exported member named 'VueRouterAutoImports'.

import { VueRouterAutoImports } from 'unplugin-vue-router'

'"unplugin-vue-router"' has no exported member named 'VueRouterAutoImports'. Did you mean 'VueRouterExports'?ts(2724)

also... Do you know how to add router.beforeEach((to, from). logic in router defined in vite.config.ts ?

im using AutoImport from unplugin-auto-import/vite ....

Default generate name and layout mechanism

First, I think this project is a great idea. and i plan to swith from

{
    "vite-plugin-pages": "^0.23.0",
    "vite-plugin-vue-layouts": "^0.6.0
}

to

{
"unplugin-vue-router": "0.0.20"
}

but I met some problems. in order to use the layout mechanism, i have to change the folder structure, and the generate name is hard to use . they are looks like this:
image

the generated name should better looks like this:

examplesDialog or examples-dialog or can be configed

folder structure had to be changed.

<pages>
    <index> 📄(default)
    ├── annimation
    │   ├── keyframework 📄(default)
    │   └── drawer 📄(default)
    ├── <index> 📄(default)
    ├── examples
    │   ├── badge 📄(default)
    │   ├── axios 📄(default)
    │   ├── dialog 📄(default)
    │   ├── form 📄(default)
    │   ├── avatar 📄(default)
    │   ├── icon 📄(default)
    │   ├── row 📄(default)
    │   ├── asset 📄(default)
    │   ├── table 📄(default)
    │   ├── spacing 📄(default)
    │   ├── typography 📄(default)
    │   ├── watermark 📄(default)
    │   └── <index> 📄(default)
    ├── blank 📄(default)
    ├── demonstrate
    │   └── windicss 📄(default)
    ├── oauth2
    │   ├── authorized 📄(default)
    │   └── login 📄(default)
    └── user
    │    ├── <index> 📄(default)
    │    ├── list 📄(default)
    │    ├── _id
    │    │   └── detail 📄(default)
    │    └── profile 📄(default)
    └── blank 📄(default)
    │    ├── 403 📄(default)
    │    ├── _ 📄(default)
    │    ├── register 📄(default)
    │    └── login 📄(default)

change the folder structure to use layout, after change(there only index folder and blank folder)

<index>
├── <index> 📄(default)
│   ├── annimation
│   │   ├── keyframework 📄(default)
│   │   └── drawer 📄(default)
│   ├── <index> 📄(default)
│   ├── examples
│   │   ├── badge 📄(default)
│   │   ├── axios 📄(default)
│   │   ├── dialog 📄(default)
│   │   ├── form 📄(default)
│   │   ├── avatar 📄(default)
│   │   ├── icon 📄(default)
│   │   ├── row 📄(default)
│   │   ├── asset 📄(default)
│   │   ├── table 📄(default)
│   │   ├── spacing 📄(default)
│   │   ├── typography 📄(default)
│   │   ├── watermark 📄(default)
│   │   └── <index> 📄(default)
│   ├── blank 📄(default)
│   ├── demonstrate
│   │   └── windicss 📄(default)
│   ├── oauth2
│   │   ├── authorized 📄(default)
│   │   └── login 📄(default)
│   └── user
│       ├── <index> 📄(default)
│       ├── list 📄(default)
│       ├── _id
│       │   └── detail 📄(default)
│       └── profile 📄(default)
└── blank 📄(default)
    ├── 403 📄(default)
    ├── _ 📄(default)
    ├── register 📄(default)
    └── login 📄(default)

and to keep the flexiblity of the folder structure when use layout, i think the plugin should provide the config like this

export default {
  plugins: [
    VueRouter({
      routesFolder: [
        //provide to config route prefix and route layout
        { dir: "src/pages", baseRoute: "" , layout:  "src/layouts/default.vue"},
        { dir: "src/features/**/pages", baseRoute: "features", layout: "src/layouts/feature.vue" },
        { dir: "src/admin/pages", baseRoute: "admin", layout: "src/layouts/blank.vue" },
      ],
    }),
  ],
};

@posva

Usage with unplugin-vue-components

Is it possible to get unplugin-vue-components to work with this plugin?

Currently the components.d.ts file that unplugin-vue-components generates uses components from vue-router (should be from @vue-router I think?):

RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']

I believe this is what's causing build errors with TS like:

Property 'isActive' does not exist on type 'RouteLocationResolvedTyped<RouteNamedMap, "/"> | RouteLocationResolvedTyped<RouteNamedMap, "/[...all]"> | ... 16 more ... | RouteLocationResolvedTyped<...>'.

11   <RouterLink :to="to" v-slot="{ isActive }">

because I can get rid of these errors by manually importing the RouterLink component from @vue-router as an example.

Struggling to get this working with `vue-cli-plugin-electron-builder`

My vue.config.js contains:

configureWebpack: {
    plugins: [
        require("unplugin-vue-router/webpack")({ routesFolder: "src/views" })
    ],
},

But that gives me the following build error:

image

If I do require("unplugin-vue-router/webpack").default({ routesFolder: "src/views" }) then it loads in fine at least, but then I get:

image

The HTML file it's referencing is in a different dir to all my .vue pages, so I'm confused why this plugin is even trying to process it. Any ideas?

Ignore components by name

It could be useful to ignore components given a pattern. e.g. src/routes/_not-a-page.vue, or .not-a-page or __not-a-page, etc but at the same time this can be achieved with the exclude option so is this really necessary?

add SFC custom block for defining per route property

hello, can't wait for this package to officially release and stable.
right now i'm using vite-plugin-pages and i'm thinking to move to this package when it will be stable enough to use in production.
right now i can't seem to find a way to defining per route meta and property like naming and meta.
as on vite-plugin-pages we can add a custom route tag on route file. is it possible to also do this on unplugin-vue-router?
thankyou

here is example on how the vite-plugin-pages do it

<route>
{
  name: "name-override",
  meta: {
    requiresAuth: false
  }
}
</route>

a way to define pee route query

is it now possible to define a safely typed route query?
i think would be good to have route query types, maybe define it on page level using the custom route block?

Usage with unplugin-auto-import

Thanks for this plugin, it's really useful to get type hints for my routes.

I'm using unplugin-auto-import and was wondering what I should do to make these two plugin gel together. According to the docs, I should replace all my vue-router imports to @vue-router but that doesn't seem to work in vite.config.ts.

So my config looks something like this:

plugins: [
    vue(),
    AutoImport({
      imports: ['vue', 'vue-router'], // can't use @vue-router here
    }),
    VueRouter({
      routesFolder: 'src/pages',
    })
  ],

Things seem to mostly work, I get type hints for my routes this way in most places (doesn't seem to work when using $route in templates though)

Am I doing things wrong or is this ok?

Update:

Things seem to break when building, I get this error as an example:

Property 'isActive' does not exist on type 'RouteLocationResolvedTyped<RouteNamedMap, "/"> | RouteLocationResolvedTyped<RouteNamedMap, "/[...all]"> | ... 16 more ... | RouteLocationResolvedTyped<...>'.

14     <RouterLink :to="to" v-slot="{ isActive }" @click="close">

This can be fixed by manually importing RouterLink from @vue-router:

import { RouterLink } from '@vue-router'

but I'd rather have the auto-import plugin work for me instead.

Change module name from `@vue-router` to a submodule of `vue-router`

Idea from antfu:

About a bit DX thing, I am thinking to have it as sub module like vue-router/loader or some other name instead of @vue-router. The way you could provide a stub module in vue-router when ppl import it without the loader/plugin, could throw out an error and says vue-router/loader requires a plugin install to work, learn more at ....

so when ppl haven't install the plugin, or misconfigured, will see this message, instead of can not found @vue-router. While when the plugin is installed, the module will be replaced with real code

implement nuxt's definePageMeta

In Nuxt, we extract route metadata through a macro and need to inject this in the generated routes. We don't serialise it but instead keep it in the rollup build and import with a custom query param, e.g. import { meta } from '~/pages/index.vue?macro=true.

Using a library like this, we would either need to take full control of the generated routes file (not the .d.ts) or have a callback to manipulate the generated file, ideally via some kind of AST that lets us have raw access to inject real code.

Edit by Eduardo: after calling with Daniel, we should add the same macro Nuxt has (definePageMeta()) See if we should name it differently and allow rename through option.

Leaving the route causes the trigger parameter to change to `undefined`

Please forgive me if I put the question in the wrong place.

Based on the following routing structure:

├─ pages/
│   └─ posts
│         ├─ [id].vue
│         └─ index.vue
│   │
│   ├─ index.vue
│   └─ posts.vue

App.vue:

<template>
  <Navbar :paths="['/', '/posts']" />
  <RouterView />
</template>

<script setup lang="ts">
import { RouterView } from 'vue-router/auto';
import Navbar from '@/components/Navbar.vue';
</script>

<style scoped></style>

pages/posts.vue:

<template>
  <Navbar :paths="['/posts/1', '/posts/2', '/posts/3', '/posts/4']" />
  <RouterView />
</template>

<script setup lang="ts">
import { RouterView } from 'vue-router/auto';
import Navbar from '@/components/Navbar.vue';
</script>

<style scoped></style>

pages/posts/index.vue:

<script setup lang="ts">
import { useFetch } from '@vueuse/core';
import type { Post } from '@/types';

const url = `${import.meta.env.VITE_BACKEND_URL}/posts`;
const { isFetching, error, data: posts } = useFetch(url).get().json<Post[]>();
</script>

pages/posts/[id].vue:

<script setup lang="ts">
import { ref, watch } from 'vue';
import { useRoute } from 'vue-router/auto';
import { useFetch } from '@vueuse/core';
import type { Post } from '@/types';

const route = useRoute('/posts/[id]');

const url = ref(`${import.meta.env.VITE_BACKEND_URL}/posts/${route.params.id}`);
const {
  isFetching,
  error,
  data: post,
} = useFetch(url, { refetch: true }).get().json<Post>();

watch(
  () => route.params.id,
  (newId) => {
    console.log(newId); // Check

    if (newId === undefined) return;
    url.value = `${import.meta.env.VITE_BACKEND_URL}/posts/${newId}`;
  },
);
</script>

When routing from /posts/2 to /posts, why is watch() in [id].vue triggered and newId will be undefined? [id].vue seems to trigger watch() again before it is destroyed. Is this the expected behavior?

related discussion: stackoverflow
main problem: why does the watch() trigger when a user has navigated away from [id].vue?

Thank you for your help!

expose unplugin options as a type that can be imported

e.g.

import type { UnpluginVueRouterOptions } from 'unplugin-vue-router'

Current workaround:

import VueRouterVitePlugin from 'unplugin-vue-router/vite'
type UnpluginVueRouterOptions = Partial<Parameters<typeof VueRouterVitePlugin>[0]>

Handle TypeScript syntax within `definePage()`

Using TS syntax will produce Syntax errors:

<script setup>
definePage({
  alias: 'thing' as string,
})
</script>

Not sure how to support this but I think it should be related to adding ?vue&type... query to import. TODO: check with the vite vue plugin

How to define types for RouterLink props?

<RouterLink :to="route">
      Link
</RouterLink>
const route = computed<??????>(() => ({
  name: '/somePath',
  params: { uuid }
}))

Error:

TS2769: No overload matches this call.
  Overload 2 of 2, '(options: WritableComputedOptions<RouteLocationAsRelativeTypedList<Record<string, RouteRecordInfo<string, string, 
RouteParamsRaw, RouteParams, RouteMeta>>>>, debugOptions?: DebuggerOptions | undefined): WritableComputedRef<...>', gave the following error.
    Argument of type '() => { name: string; params: { uuid: string; }; }' is not assignable to parameter of type 'WritableComputedOptions<RouteLocationAsRelativeTypedList<Record<string, RouteRecordInfo<string, string, RouteParamsRaw, RouteParams, RouteMeta>>>>'. 

handle `.page.vue` extension

when configuring the vite plugin with a .page.vue extension, the generated route config includes e.g. /index.page for ./src/pages/index.page.vue:

// vite.config.ts
import vue from '@vitejs/plugin-vue'
import router from 'unplugin-vue-router/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    router({ dts: './routes.d.ts', extensions: ['.page.vue'] }),
    vue(),
  ],
})
// snippet from generated routes.d.ts
declare module 'vue-router/auto/routes' {
  export interface RouteNamedMap {
    '/index.page': RouteRecordInfo<
      '/index.page',
      '/index/page',
      Record<never, never>,
      Record<never, never>
    >
  }
}

Redirect not works

<route lang="yaml">
redirect:
  name: Root
</route>

Redirect not works with route tag.

support for multiple routes folders

In Nuxt we allow defining pages in a ~/pages directory, but also in any number of other 'layers' which can each have their own ~/pages directory. It would be nice to support an array for the routesFolder option.

Adding meta for routes without a component

Creating folders create routes and any file inside them becomes a nested route. This wasn't possible before v4.1 but now it makes sense to allow defining meta properties (mainly but also any other route property) at this level

This could maybe be achieved with a special file users/__route.js that exports some properties like name, meta, etc (the same as in the <route> block)

type ignoring folder with bracket

so i have a dynamic route on a folder name [path] is a folder and not a vue file. using useRoute with the route name does not infering the route type, it is ignoring the path if it is a folder

here is the code.
image

here is how the folder structure
image

bug: catchall doesn't work recursively due to children structure

Given what I'm used to with vite-plugin-pages, I generally have one catch-all at the top level of the routes folder, which is meant to catch all unknown routes, regardless of what route a user puts in.

Given this snippet from the readme:


Catch all / 404 Not found route

To create a catch all route prepend 3 dots (...) to the param name, e.g. src/pages/[...path].vue will create a route with the following path: /:path(.*). This will match any route. Note this can be done inside a folder too, e.g. src/pages/articles/[...path].vue will create a route with the following path: /articles/:path(.*).


Specifically:

This will match any route.

Doesn't seem like that's the case with the current implementation. Given the following route folder structure:

$ tree src/pages/
src/pages/
├── [...catchall].vue
├── articles
│   └── [id].vue
└── index.vue

The following routes would trigger the catch-all:

  • /foo
  • /foo/bar
  • /foo/bar/baz

The following would work as expected, and load the appropriate components/routes:

  • /
  • /articles/<id>

However, the following will not, and will match essentially no route (resulting in an empty component tree):

  • /articles
  • /articles/

The above don't trigger catchall, or really any route. For example, I have an app that simply uses RouterView as the "root" app component. When I set up the pages like shown above, this is what the component tree looks like for /articles/<id>:

And /foo/bar:

Aaand /articles/:

Looks like this is due to the children functionality, where if you don't have an index.vue (which shouldn't be required for a sub-folder), there is no associated component:

[
  {
    "path": "/",
    "name": "home"
  },
  {
    "path": "/:catchall(.*)",
    "name": "/[...catchall]"
  },
  {
    "path": "/articles",
    "children": [
      {
        "path": ":id",
        "name": "/articles/[id]"
      }
    ]
  }
]

This is not ideal for a few reasons:

  • Have to either duplicate catch-alls all over the place (putting one in pages/articles/[...catchall].vue works)
  • Have to have a pages/articles/index.vue for all similar routes. Also not ideal.

I have setup a repro repo to better explain the scenario, which doesn't include any special wrapping libraries for routes (pulled from the playground with modifications to simplify/clean up):

https://github.com/lrstanley/bug-vue-router-empty-param

RouterLink v-slot props missing types

We're missing some types for route, navigate,isActive and isExactActive slot props.

Property 'route' does not exist on type 'RouteLocationResolvedTyped<RouteNamedMap, "/AboutView"> | RouteLocationResolvedTyped<RouteNamedMap, "/HomeView">'.

23           v-slot="{ href, route, navigate, isActive, isExactActive }"

image

I have a reproduction repo ready if you need it.

not working with vite-plugin-vue-layouts

the problem with route block on #23 is resolved.
however 5d3c040 make the vite-plugin-vue-layouts does not work, its ignoring the layout and just showing the page content.

screenshot, supposed to have sidebar and navbar but now only showing the content.
image

Extract name and path from `definePage()`

Currently, name and path defined through definePage() are not added to the types like it happens with the route block but it should be possible since they are extracted through the AST

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.