You can generate new pages in Nuxt.js using the nuxt generate command
# Generates `pages/about.vue`
npx nuxi add page about
# Generates `pages/category/[id].vue`
npx nuxi add page "category/[id]"
To create components using the Nuxt.js CLI (Command Line Interface), you can use the generate command. Here's how you can create components:
To create a component using the CLI:
npx nuxi add component YourComponentName
By default, this command creates the following: <YourComponentName>
is the name of your component.
In Nuxt.js 3, you can generate custom commands using the @nuxt/cli package. For example, to generate a custom command:
npx nuxt create command my-custom-command