Create a Page
To create standalone pages, you can follow the provided instructions. Here are the steps to create the specified vue files for standalone pages:
- Create a file at
pages/anything.vue
:
<script setup>
console.log("Js Code");
</script>
<template>
<div>
<h1>Home Page</h1>
<p>This is the Home Page</p>
</div>
</template>
This file will create a standalone home page accessible at http://localhost:3000/ (opens in a new tab).
- Create a file at
pages/foo/index.vue
:
<script setup>
console.log("Js Code");
</script>
<template>
<div>
<h1>Foo Page</h1>
<p>This is the Foo Page</p>
</div>
</template>
This file will create a standalone page accessible at http://localhost:3000/foo (opens in a new tab).
- Create a file at
pages/foo/[slug].vue
:
<script setup>
console.log("Js Code");
</script>
<template>
<div>
<h1>Inner page</h1>
<p>This is the Inner Page</p>
</div>
</template>
This file will create a dynamic standalone page where the slug can be replaced with any value. It will be accessible at http://localhost:3000/foo/bar (opens in a new tab), where "bar" can be replaced with any desired slug value.
By following these steps and creating the respective vue files, you can create the specified standalone pages in your Nuxt application.