VUE from entry to abandon (the whole process of the project) ---- VUE

VUE from entry to give up (the first day) - the overall process

Think about a project, vue project is from what to what, and then what? what is that?

  1. Structures (vue-cli)
  2. Code Contents
  3. run
  4. Package
  5. End product

I. structures (Scaffolding vue-cli)

First node.js, npm, vue-cli (scaffolding) must have, do not go into detail here. Mounted on the bin.

Want to put into the folder, the init VUE WebPACK XXXVue (project name, as you take), configuration:

  1. Project name (my-vue)? --------- project name (My-Vue)?

  2. Project description (A Vue.js project) --------- Item Description (Vue.js project)?

  3. Author? --------- author?

  4. Install vue-router? (Y / n) --------- installation route vue

  5. Use ESLint to lint your code? (Y / n) (start checking ?? look up your code is wrong, the line is not open, open is required.)

  6. ? Set up unit tests (Y / n) n carriage can knock (unit testing, the individual feels not installed selected n)

  7. ? Setup e2e tests with Nighwatch? (Y / n) (e2e test individuals do not feel installation options n)

  8. ?Should we run npm install for you after the project has been created? (recommended) (use arrow Keys) 选使用npm

Project folder in the command line: npm install (installation dependent, since you can do whatever they want npm i xxx a)

XXXXVue folder one more node_modules folder.

img

II. Code Content ()

Here Insert Picture Description

Contents: ↑

  1. dist is the result of npm run build file after the packaged files are very small. dist normal can not be opened directly required by the server, cloud server line, with local phpstudy what's required. (Packed behind when mention about)
  2. package.json and config: configuration files are
  3. assets: pictures Yeah, Yeah resources, these are stored here.
  4. node_modules: resource after npm, are on the inside, want ui library directly npm i xxx library.
  5. src / components: component storage. What must first component (example: helloworld.vue), to this place, you can call the
  6. src / router: routing,
  7. build: Start the Package file.

III. Run (npm run dev)

Run the command: npm RUN dev

Loaded, get!

IV. Package (npm run build)

dist is the result of npm run build file after the packaged files are very small. dist normal can not be opened directly required by the server, cloud server line, with local phpstudy what's required.

It may be made into a decapsulation H5 app. Packaging can use the cloud.

V. Finished

  1. By placing a server, the cloud server also, what is also phpstudy with local row.
  2. Through the cloud packaged into a app.
  3. No other contact.

Guess you like

Origin www.cnblogs.com/cth0/p/11564731.html