Nuxt3实战和核心内容介绍

545 阅读1分钟

Nuxt3 

  • Spa & SSR difference
  • Nuxt3 Feature
  • Nuxt3 File Structure
  • Composables
  • Data Fetch & Error 
  • Nuxt3 Module & Layer & Kit

image.png

image.png

Conclusion

Client-side rendering is a good choice for heavily interactive web applications that don't need indexing or whose users visit frequently. It can leverage browser caching to skip the download phase on subsequent visits, such as SaaS, back-office applications, or online games.

image.png

image.png

Conclution

Universal rendering is very versatile and can fit almost any use case, and is especially appropriate for any content-oriented websites: blogs, marketing websites, portfolios, e-commerce sites, and marketplaces.

Let`s Overview Nuxt3

development friendly

  • Auto-imports
  • File-system routing and API layer
  • Data-fetching utilities
  • Zero-config TypeScript support
  • Configured build tools
  • Universal rendering 
  • Client-side only rendering
  • Hybrid rendering (per-routes caching strategy)
  • Full Static site generation

How To Start Nuxt3

Nuxt3 start up 

  1. npx nuxi init

  2. cd project-name

  3. yarn install

  4. yarn dev

image.png

image.png

image.png

image.png

image.png

To Use Composables

image.png

composables

  • useAppConfig
  • useAsyncData
  • useCookie
  • useError
  • useFetch
  • useHead
  • useHydration
  • useLazyAsyncData
  • useStorage
  • useLazyFetch

  • useNuxtApp

  • useNuxtData

  • useRequestEvent

  • useRequestHeaders

  • useRoute

  • useRouter

  • useRuntimeConfig

  • useState

    Too much ! What is I Need

image.png

image.png

image.png

image.png

image.png

image.png

image.png

How To Data Fetch

image.png

image.png

image.png

image.png

image.png

Nuxt3 More

  • Nuxt Layers

  • Nuxt Module

  • Nuxt Kit

image.png

image.png

image.png