From ab3f8cb74ca44ef9842b779bddf1201309e115e5 Mon Sep 17 00:00:00 2001 From: HomWang <516310460@qq.com> Date: Tue, 23 Aug 2022 10:12:03 +0800 Subject: [PATCH] Modify `pages/index.vue` and content Add `tsx` and `template`, and change the content to `Welcome to nuxt3` --- .../2.guide/3.directory-structure/10.pages.md | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/content/2.guide/3.directory-structure/10.pages.md b/docs/content/2.guide/3.directory-structure/10.pages.md index 9bf36c07f39..09d1cfc147e 100644 --- a/docs/content/2.guide/3.directory-structure/10.pages.md +++ b/docs/content/2.guide/3.directory-structure/10.pages.md @@ -19,8 +19,27 @@ Pages are Vue components and can have the `.vue`, `.js`, `.jsx`, `.ts` or `.tsx` ::code-group ```vue [pages/index.vue] + ``` @@ -28,7 +47,7 @@ Pages are Vue components and can have the `.vue`, `.js`, `.jsx`, `.ts` or `.tsx` // https://vuejs.org/guide/extras/render-function.html export default defineComponent({ render () { - return h('h1', 'Index page') + return h('h1', 'Welcome to nuxt3') } }) ``` @@ -37,11 +56,13 @@ export default defineComponent({ // https://vuejs.org/guide/extras/render-function.html#jsx-tsx export default defineComponent({ render () { - return

Index page

+ return

Welcome to nuxt3

} }) ``` +- `index.vue`: `window` can be used in functional components, and does not need to do `process.client` judgment + :: The `pages/index.vue` file will be mapped to the `/` route of your application.