Reference nuXT project template modified, can save some things ~

Mainly integrated with iView, @nuxtJS/AXIos, ESLint (Airbnb), some compatible Polyfill, PM2 configuration files

The use of element-UI is the same, and it can be loaded on demand in some way. I tried iView before, but I didn’t want to import it every time. Lazy

=> github

Personally, by the way

nuxt

Nuxt has advantages over SPA in terms of experience. The isomorphic framework is similar to next, with basically the same properties

  • First comment render fast? It also depends on how fast your interface is, otherwise you can’t add loading like SPA. When the data gets to render, the screen will only be blank or stay on the previous page. After the interface returns, the page will jump, but the page will appear immediately after the jump, which makes people feel much more comfortable
  • Because the server side does not have browser-related objects, so there are often a lot of plug-in code using objects like Window, location, etc., that will be a direct error, can only be put on the server side, small plug-in is ok, but as a large component library like iView, the original version is still very old does not support SSR, it is very painful
  • Cookie, storage pit, development must be separated from the server side and the client side, because the server side can not get storage, cookie can be obtained from reQ, but can not set.
  • For debugging, the first opening of the page is handled by the server side first, so the client side, Chrome Network, can not see the interface request, can only see the page has been filled with data, but if an error is reported, the problem can not be immediately located as SPA

Problems encountered in other aspects should not be too much, and spa will not be too different.

I’ve been refactoring this framework for several of my company’s projects, and I’ve had a few bumps in the update cycle, which is now 1.1.1. And ops to upgrade all the development and production of all the node version, upgrade a few times before how many there are some old projects an error, and then back to back, this time because of many projects are reconstructed, the process is no big problem, but also spent a day, after all, about ten projects, dev, uat, and prod the two servers…).

use

Install the vue – first cli.

$ vue init bwcmall/nuxt my-project  
$ cd my-project                     
# install dependencies
$ npm install # Or yarn install
Copy the code