# nuxt-element **Repository Path**: zh423328/nuxt-element ## Basic Information - **Project Name**: nuxt-element - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-04 - **Last Updated**: 2024-09-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### NUXT ``` nuxt 自带服务器Nitro //判断客户端还是服务端 if (import.meta.server) { console.log('server') } else { console.log('client') } 切换路由的时候,用的是客户端渲染 //约定路由 - hi -- [id].vue //访问localhost:3000/hi/123 //客户端和服务器端都可以访问 navigateTo('/hi/123') ``` ## composeable 不需要导入 ``` composables 里面的文件不需要导入,会自动导入,但是只会扫描一层目录 useAsyncData只会执行一次 useFetch ```