我正在使用NUXT 3,据我所知,您可以在客户端和服务器中使用useasyncdata()和usefetch()。 NUXT 3 SSR Universal可以与SEO一起使用,因为爬网不是缓存文件,因此每个请求都是分开的,因此爬网每次从服务器中获得SSR HTML文件时。您可以使用秘密,如果您要在“服务器”文件夹中创建API调用,则可以单独的功能来使API调用它而不是使用网页。调用此API仅发送用户,例如JSON文件,而不是服务器/*。JS文件中的整个代码。
I'm working with Nuxt 3 and as far as I know you can use useAsyncData() and useFetch() in both client and server. Nuxt 3 SSR universal works fine with SEO because crawlers not cache files so every request is separate, so crawlers get every time SSR HTML file from server. You can use secrets if beside web page you want to create API calls from "server" folder, this is separate functionality to make API calls it not marge with web page. Calling this API will send user only for example JSON file, not whole code from a server/*.js files.
发布评论
评论(1)
我正在使用NUXT 3,据我所知,您可以在客户端和服务器中使用
useasyncdata()
和usefetch()
。 NUXT 3 SSR Universal可以与SEO一起使用,因为爬网不是缓存文件,因此每个请求都是分开的,因此爬网每次从服务器中获得SSR HTML文件时。您可以使用秘密,如果您要在“服务器”文件夹中创建API调用,则可以单独的功能来使API调用它而不是使用网页。调用此API仅发送用户,例如JSON文件,而不是服务器/*。JS文件中的整个代码。I'm working with Nuxt 3 and as far as I know you can use
useAsyncData()
anduseFetch()
in both client and server. Nuxt 3 SSR universal works fine with SEO because crawlers not cache files so every request is separate, so crawlers get every time SSR HTML file from server. You can use secrets if beside web page you want to create API calls from "server" folder, this is separate functionality to make API calls it not marge with web page. Calling this API will send user only for example JSON file, not whole code from a server/*.js files.