nuxt steps to create the project

nuxt steps to create the project

 

1. Basic steps

 

// Create a file dependency management package.json 
npm the init - the y- 



// add commands to run nuxt package.json file to start the project after npm run dev 
{
   "name": "App-My" ,
   "scripts" : {
     " dev ":" nuxt " 
  } 
} 



// install nuxt.js 
npm install --save nuxt install or CNPM - the Save nuxt 



// create a page directory, nuxt will be generated according to the routing prefix name xxx.vue under the page, through prefix name to access the component 



// Assets directory: used to store static resources, but to build compiled in this directory to store static resources will be nuxt use webpack, store static resources such as less, sass resource files, use the directory introduced the ~ assets / main.scss, incorporated prefix ~ 



// compoents directory: VUE for tissue components, nuxt reinforcing component does not extend under the directory 



// layouts directory: a tissue component layout application, the definition of the application default part, and 404 components, etc. 



//middleware Middleware directory: used to store application middleware, middleware is some way that he could be called before the page loads 




// plugins plugin directory: javascript plugin before application initialization vue organization to run, you can also define your own method of 




// Store Catalog: organize applications vuex state file 




// nuxt.config.js file: personalized organizational configuration of the application, nuxt profile

 

2. Directory Structure

 

 

 

Guess you like

Origin www.cnblogs.com/zxuedong/p/12548634.html