VUE-Scaffolding construction, vue-scaffolding

Source: Internet
Author: User

VUE-Scaffolding construction, vue-scaffolding

1. What is vue-cli?

Vue-cli is a scaffold of vue. js and is used to automatically generate a vue. js Project template.

Steps:

2. Installation
-> Global installation
Npm install vue-cli-g
Or
Cnpm install vue-cli-g
-> Check whether the installation is successful.
Vue-V (uppercase V)
3. Use
-> The generated project name is a wsw template.
Vue init webpack wsw
-> Go to the project and install the dependency
Cd wsw
Cnpm install
-> RUN
Npm run dev

4. vue directory structure

Directory resolution

Directory/File Description
Build The location where the final released code is stored.
Config Configuration directory, including the port number. We can use the default one for beginners.
Node_modules Project dependency module loaded by npm
Src

Here is the directory we want to develop. Basically, everything we want to do is in this directory. It contains several directories and files:

  • Assets: Place images, such as logos.
  • Components: a component file is stored in the directory.
  • App. vue: Project entry file. You can also directly write the component here without using the components directory.
  • Main. js: the core file of the project.
Static Static resource directories, slices, fonts, and so on.
Test Initial test directory, which can be deleted
. Xxxx File These are some configuration files, including syntax configuration and git configuration.
Index.html You can add meta information or statistical code to the homepage entry file.
Package. json Project configuration file.
README. md Project description, in markdown format

Re-open the page http: // localhost: 8080/. Generally, the page is automatically refreshed after modification. The result is as follows:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.