Nuxt.js
解决了 Vue
搜索引擎爬虫抓不到这个问题,且可以提高首屏加载的速度。
Nuxt.js
从服务器请求数据,之后渲染界面。服务端渲染对 SEO
友好,在经过网络传输的时候,爬虫客户端爬到页面后会分析页面,这样页面的关键数据就会被爬虫收录。
构建命令如下:
vue init nuxt-community/koa-template nuxt-learn
yarn install or npm install
npm run dev
出现报错
ERROR Failed to compile with 1 errors20:10:54
error in ./server/index.js
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In D:\vue\VueBase\nuxt-learn\node_modules\backpack-core\babel.js
at createDescriptor (D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
at D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js