nuxt.js是一個(gè)SSR服務(wù)器渲染框架揭措,優(yōu)點(diǎn)是:首頁加載速度快驯绎,在服務(wù)器上加載完整的帶數(shù)據(jù)完慧,javascript,css的html結(jié)構(gòu)剩失。缺點(diǎn)是:服務(wù)器任務(wù)重屈尼,適合靜態(tài)頁面。
1:npm5后都自帶npx:E:\Node_js>npx -v 6.14.11檢查是否安裝npx
2:E:\Node_js>npx create-nuxt-app 502link_h5創(chuàng)建名字
3:填選一些選項(xiàng):create-nuxt-app v4.0.0
? Generating Nuxt.js project in 502link_h5
? Project name: 502link_h5
? Programming language: JavaScript
? Package manager: Npm
? UI framework: None
? Nuxt.js modules: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Linting tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Testing framework: None
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? What is your GitHub username? (李————)
? Version control system: Git
4:選擇上述提供的命令:
To get started:
cd 502link_h5
npm run dev
5:打開瀏覽器 :Listening: http://localhost:3000/
6:在vscode中導(dǎo)入項(xiàng)目開始寫拴孤;
7:創(chuàng)建構(gòu)成中的注意點(diǎn):
如何打開別人的nuxt.js文件:
npm i
npm run dev